diff options
Diffstat (limited to 'core/views/logbooks.py')
-rw-r--r-- | core/views/logbooks.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/views/logbooks.py b/core/views/logbooks.py index d9e2192..10a9bee 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -193,6 +193,9 @@ def person( this_person = Person.objects.get(first_name=first_name, last_name=last_name) except: message = f"Person not found '{first_name} {last_name}' - possibly Scottish? (See our <a href=\"/handbook/troggle/namesredesign.html\">Proposal to fix this</a>)" + peeps = Person.objects.filter(first_name=first_name, last_name=last_name) + if len(peeps) > 1: + message = f"Multiple people ({len(peeps)}) with this name '{first_name} {last_name}' - (See our <a href=\"/handbook/troggle/namesredesign.html\">Proposal to fix this</a>)" return render(request, "errors/generic.html", {"message": message}) return render(request, "person.html", {"person": this_person}) @@ -232,8 +235,8 @@ def get_person_chronology(personexpedition): return res2 -def personexpedition(request, first_name="", last_name="", year=""): - person = Person.objects.get(first_name=first_name, last_name=last_name) +def personexpedition(request, slug="", year=""): + person = Person.objects.get(slug=slug) this_expedition = Expedition.objects.get(year=year) personexpedition = person.personexpedition_set.get(expedition=this_expedition) personchronology = get_person_chronology(personexpedition) |