Skip to content

Commit

Permalink
Simplify org users query
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsetzer committed Nov 26, 2024
1 parent 09df1bd commit 89a5867
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions perma_web/perma/views/user_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,7 @@ def manage_organization_user_export_user_list(request: HttpRequest):
'organization_name',
]
records = list_users_in_group(request, 'organization_user', export=True)
org_users = (
records.values('email', 'first_name', 'last_name', 'date_joined', 'last_login')
.annotate(organization_name=F('organizations__name'))
.values(*field_names)
)
org_users = records.annotate(organization_name=F('organizations__name')).values(*field_names)
filename = 'perma-organization-users'

# Export records in appropriate format based on `format` URL parameter
Expand Down

0 comments on commit 89a5867

Please sign in to comment.