Skip to content

Commit

Permalink
OM-69 added default case for roles and eu
Browse files Browse the repository at this point in the history
  • Loading branch information
malinowskikam committed Oct 31, 2023
1 parent 518ed4e commit cec6e0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions msystems/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ 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:
legal_entities = self._parse_legal_entities(user_data.get('OrganizationAdministrator'))
legal_entities = self._parse_legal_entities(user_data.get('OrganizationAdministrator', []))
policyholders = [self._get_or_create_policy_holder(user, line[1], line[0]) for line in legal_entities]

self._delete_old_user_policyholders(user, policyholders)
self._add_new_user_policyholders(user, policyholders)

def _update_user_roles(self, user, user_data):
msystem_roles_list = user_data.get('Role')
msystem_roles_list = user_data.get('Role', [MsystemsConfig.EMPLOYER])

self._delete_old_user_roles(user, msystem_roles_list)
self._add_new_user_roles(user, msystem_roles_list)
Expand Down

0 comments on commit cec6e0c

Please sign in to comment.