2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

more attempts to recognise scotsmen

This commit is contained in:
Philip Sargent 2021-04-20 23:57:51 +01:00
parent 8f0e7435d6
commit 18938c9fca
2 changed files with 2 additions and 4 deletions

View File

@ -119,7 +119,7 @@ def person(request, first_name='', last_name='', ):
this_person = Person.objects.get(first_name = first_name, last_name = last_name)
return render(request,'person.html', {'person': this_person, })
except:
message = f'Person not found \'{first_name}-{last_name}\' - possibly Scottish? (We have a name parser issue with Mc, Mac etc.)'
message = f'Person not found \'{first_name} {last_name}\' - possibly Scottish? (We have a name parser issue with Mc, Mac etc.)'
return render(request, 'errors/generic.html', {'message': message})

View File

@ -78,9 +78,7 @@ trogglepatterns = [
#re_path(r'^accounts/', include('django.contrib.auth.urls')), # from Dj3.0, see site-packages\registration\auth_urls_classes.py
# Persons - nasty surname recognition logic fails for 19 people!
# re_path(r'^person/(?P<person_id>\d*)/?$', person), makes Ruairidh MacLeod work but kills MacLean
# re_path(r'^person/(\w+_\w+)$', logbooks.person, name="person"),
re_path(r'^person/(?P<first_name>[A-Z]*[a-z\-\'&;]*)[^a-zA-Z]*(?P<last_name>[a-z\-\']*[^a-zA-Z]*[A-Z]*[a-zA-Z\-&;]*)/?', person, name="person"),
re_path(r'^person/(?P<first_name>[A-Z]*[a-z\-\'&;]*)[^a-zA-Z]*(?P<last_name>[a-z\-\']*[^a-zA-Z]*[\-]*[A-Z]*[a-zA-Z\-&;]*)/?', person, name="person"),
re_path(r'^personexpedition/(?P<first_name>[A-Z]*[a-z&;]*)[^a-zA-Z]*(?P<last_name>[A-Z]*[a-zA-Z&;]*)/(?P<year>\d+)/?$', personexpedition, name="personexpedition"),
# Expedition master page