From 7db97064f7058299a7c9b610127e553aba04dd67 Mon Sep 17 00:00:00 2001 From: sophia-massie <96220951+sophia-massie@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:25:02 -0500 Subject: [PATCH] bug/WP-697-User-Org-Filter-Bug (#317) * bug/WP-697-User-Org-Filter-Bug * remove debug statements --------- Co-authored-by: Chandra Y --- apcd_cms/src/apps/view_users/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apcd_cms/src/apps/view_users/views.py b/apcd_cms/src/apps/view_users/views.py index 1a65dcec..67b96cea 100644 --- a/apcd_cms/src/apps/view_users/views.py +++ b/apcd_cms/src/apps/view_users/views.py @@ -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'] @@ -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')