Skip to content

Commit

Permalink
bug/WP-697-User-Org-Filter-Bug (#317)
Browse files Browse the repository at this point in the history
* bug/WP-697-User-Org-Filter-Bug

* remove debug statements

---------

Co-authored-by: Chandra Y <[email protected]>
  • Loading branch information
sophia-massie and chandra-tacc authored Sep 20, 2024
1 parent cfdab2d commit 7db9706
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apcd_cms/src/apps/view_users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def _set_user(usr):
'status': 'Active' if usr[8] else 'Inactive',
'user_number': usr[9],
'role_name': usr[10],
'entity_name_no_parens': usr[4].replace("(", "").replace(")", "") if usr[4] else "Not Applicable", # just for filtering purposes
'entity_name_no_parens': usr[4].replace("(", "").replace(")", "") if usr[4] else "None", # just for filtering purposes
'active': usr[8],
}

context['header'] = ['User ID', 'Name', 'Entity Organization', 'Role', 'Status', 'User Number', 'See More']
context['status_options'] = ['All', 'Active', 'Inactive']
context['filter_options'] = ['All']
context['filter_options'] = ['All', 'None']
context['role_options'] = ['SUBMITTER_USER', 'SUBMITTER_ADMIN','APCD_ADMIN']

context['status'] = ['Active', 'Inactive']
Expand All @@ -96,11 +96,11 @@ def _set_user(usr):
table_entries = []
for user in user_content:
table_entries.append(_set_user(user,))
org_name = user[4]
org_name = user[4] if user[4] else None
if org_name not in context['filter_options']: # prevent duplicates
context['filter_options'].append(user[4])
context['filter_options'] = sorted(context['filter_options'],key=lambda x: (x != 'All', x is None, x if x is not None else ''))

queryStr = ''
status_filter = self.request.GET.get('status')
org_filter = self.request.GET.get('org')
Expand Down

0 comments on commit 7db9706

Please sign in to comment.