Skip to content

Commit

Permalink
Merge pull request #38 from openimis/feature/OM-369
Browse files Browse the repository at this point in the history
OM-369: adjustments to add new way of authorizing users
  • Loading branch information
olewandowski1 authored Nov 20, 2024
2 parents cf5e1b6 + 8b79391 commit e34480a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions msystems/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"mpass_key_dob": "BirthDate",
"mpass_key_roles": "Role",
"mpass_key_legal_entities": "OrganizationAdministrator",
"mpass_key_additional_legal_entity": "AdministeredEntities",
# "mpass_key_legal_entities": "AdministeredLegalEntity",


Expand Down
3 changes: 3 additions & 0 deletions msystems/services/mpass_user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def _update_user(self, user: User, user_data: dict) -> None:
self._update_user_name(user.i_user, data_first_name, data_last_name)

def _update_user_legal_entities(self, user: User, user_data: dict) -> None:
if MsystemsConfig.mpass_config["mpass_key_additional_legal_entity"] in user_data:
user_data[MsystemsConfig.mpass_config["mpass_key_legal_entities"]] \
= user_data[MsystemsConfig.mpass_config["mpass_key_additional_legal_entity"]]
legal_entities = self._parse_legal_entities(user_data.get(MsystemsConfig.mpass_config["mpass_key_legal_entities"], []))
policyholders = [self._get_or_create_policy_holder(user, line[1], line[0]) for line in legal_entities]

Expand Down

0 comments on commit e34480a

Please sign in to comment.