Improve search with legal first name

This commit is contained in:
Tanner Collin 2021-04-16 01:13:36 +00:00
parent e6beab0ff6
commit 74dfdc6c06

View File

@ -144,16 +144,18 @@ def gen_search_strings():
''' '''
search_strings = {} search_strings = {}
for m in models.Member.objects.order_by('-expire_date'): for m in models.Member.objects.order_by('-expire_date'):
string = '{} {}'.format( string = '{} {} | {} {}'.format(
m.preferred_name, m.preferred_name,
m.last_name, m.last_name,
m.first_name,
m.last_name,
) )
if m.old_email: if m.old_email:
string += ' ' + m.old_email string += ' | ' + m.old_email
if m.user: if m.user:
string += ' ' + m.user.email string += ' | ' + m.user.email
string += ' ' + str(m.id) string += ' | ' + str(m.id)
string = string.lower() string = string.lower()
search_strings[string] = m.id search_strings[string] = m.id