Skip to content

Commit

Permalink
add todos, update comments (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Jul 1, 2024
1 parent eab3777 commit 2ced623
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions projectroles/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ def clean(self):
pass

# Local users check
# TODO: Add OIDC users for this check
if user_email:
domain = user_email[user_email.find('@') + 1 :]
domain_list = [
Expand Down
1 change: 1 addition & 0 deletions projectroles/management/commands/checkusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def handle(self, *args, **options):
return
self._check_search_base_setting(primary=True)
self._check_search_base_setting(primary=False)
# TODO: Limit this to users with LDAP domains in username
users = User.objects.filter(username__contains='@').order_by('username')
limit = options.get('limit')
if not limit or limit == 'ldap1':
Expand Down
10 changes: 5 additions & 5 deletions projectroles/remote_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ def _check_local_categories(self, uuid):

def _sync_user(self, uuid, user_data):
"""
Synchronize LDAP or local user on target site. For local users, will
only update an existing user object. Local users must be manually
created. If local users are not allowed, data is not synchronized.
Synchronize user on target site. For local users, will only update an
existing user object. Local users must be manually created. If local
users are not allowed, data is not synchronized.
:param uuid: User UUID (string)
:param user_data: User sync data (dict)
Expand Down Expand Up @@ -750,7 +750,7 @@ def _update_roles(self, project, project_data):
self._handle_user_error(error_msg, project, r_uuid)
continue

# Use the default owner, if owner role for a non-LDAP user and local
# Use the default owner, if owner role is for local user and local
# users are not allowed
if (
r['role'] == PROJECT_ROLE_OWNER
Expand All @@ -763,7 +763,7 @@ def _update_roles(self, project, project_data):
role_user = self.default_owner
# Notify of assigning role to default owner
status_msg = (
'Non-LDAP/AD user "{}" set as owner, assigning role '
'Local user "{}" set as owner, assigning role '
'to user "{}"'.format(
r['user'], self.default_owner.username
)
Expand Down

0 comments on commit 2ced623

Please sign in to comment.