Skip to content

Commit

Permalink
update fix (#1315, #1320)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Oct 31, 2023
1 parent f193b70 commit f054b35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion projectroles/remote_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,13 @@ def _sync_app_setting(cls, uuid, set_data):
project = Project.objects.get(sodar_uuid=ad['project_uuid'])
# TODO: Use UUID for LDAP users once #1316 and #1317 are implemented
if ad.get('user_name'):
user = User.objects.get(username=ad['user_name'])
# User may not be found if e.g. local users allowed but not created
user = User.objects.filter(username=ad['user_name']).first()
if not user:
logger.info(
'Skipping setting {}: User not found'.format(ad['name'])
)
return
# Skip for now, as UUIDs have not been correctly synced
# TODO: Remove skip after #1316 and #1317
elif ad['user_uuid']:
Expand Down
2 changes: 1 addition & 1 deletion projectroles/tests/test_remote_projects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1970,4 +1970,4 @@ def test_update_no_changes(self):
] = 'updated'
self.assertEqual(original_data, remote_data)

# TODO: Test for USER and PROJECT_USER settings
# TODO: Test syncing of PROJECT_USER settings with differing user UUIDs

0 comments on commit f054b35

Please sign in to comment.