Unverified Commit 07daf104 authored by Joost Rijneveld's avatar Joost Rijneveld
Browse files

members: only search in nicks when displayed

parent d5380dfd
...@@ -38,10 +38,13 @@ def filter_users(tab, keywords, year_range): ...@@ -38,10 +38,13 @@ def filter_users(tab, keywords, year_range):
if keywords: if keywords:
for key in keywords: for key in keywords:
members_query &= (Q(nickname__icontains=key) | members_query &= (
Q(user__first_name__icontains=key) | (Q(user__member__nickname__icontains=key) &
Q(user__last_name__icontains=key) | # Works because relevant options all have `nick` in their key
Q(user__username__icontains=key)) Q(user__member__display_name_preference__contains='nick')) |
Q(user__first_name__icontains=key) |
Q(user__last_name__icontains=key) |
Q(user__username__icontains=key))
if tab == 'ex': if tab == 'ex':
memberships_query = Q(type='member') | Q(type='honorary') memberships_query = Q(type='member') | Q(type='honorary')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment