From 74dfdc6c062969e805cbc4f7850b69fb45440c14 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 16 Apr 2021 01:13:36 +0000 Subject: [PATCH] Improve search with legal first name --- apiserver/apiserver/api/utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apiserver/apiserver/api/utils.py b/apiserver/apiserver/api/utils.py index fb3b289..7888882 100644 --- a/apiserver/apiserver/api/utils.py +++ b/apiserver/apiserver/api/utils.py @@ -144,16 +144,18 @@ def gen_search_strings(): ''' search_strings = {} for m in models.Member.objects.order_by('-expire_date'): - string = '{} {}'.format( + string = '{} {} | {} {}'.format( m.preferred_name, m.last_name, + m.first_name, + m.last_name, ) if m.old_email: - string += ' ' + m.old_email + string += ' | ' + m.old_email if m.user: - string += ' ' + m.user.email - string += ' ' + str(m.id) + string += ' | ' + m.user.email + string += ' | ' + str(m.id) string = string.lower() search_strings[string] = m.id