Skip to content

Commit

Permalink
[#88] fix role delete/create issue str vs. int
Browse files Browse the repository at this point in the history
  • Loading branch information
mjstealey committed Oct 23, 2024
1 parent a3b26d2 commit fce9f0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/swagger_server/response_code/comanage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ def update_people_roles(fab_person_id: int, co_person_id: int) -> None:
fab_person = FabricPeople.query.filter_by(id=fab_person_id).one_or_none()
co_roles = api.coperson_roles_view_per_coperson(coperson_id=co_person_id).get('CoPersonRoles', [])
fab_roles = fab_person.roles
co_role_ids = [r.get('Id') for r in co_roles]
fab_role_ids = [str(r.co_person_role_id) for r in fab_roles]
co_role_ids = [int(r.get('Id')) for r in co_roles]
fab_role_ids = [int(r.co_person_role_id) for r in fab_roles]
roles_added = array_difference(co_role_ids, fab_role_ids)
roles_removed = array_difference(fab_role_ids, co_role_ids)
# remove old Fabric roles
Expand Down
5 changes: 2 additions & 3 deletions server/swagger_server/response_code/whoami_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ def whoami_get() -> Whoami: # noqa: E501
try:
# get person from people table
api_user, id_source = get_person_by_login_claims()
print(id_source)
if id_source in []:
pass
if id_source in ['exception']:
consoleLogger.info('WARNING: Exception detected: get_person_by_login_claims')
if not api_user.co_person_id:
details = 'Enrollment required: {0}'.format(os.getenv('CORE_API_401_UNAUTHORIZED_TEXT'))
consoleLogger.info("unauthorized_access(): {0}".format(details))
Expand Down

0 comments on commit fce9f0d

Please sign in to comment.