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

error message for new person pre database reset

This commit is contained in:
Philip Sargent 2024-04-21 20:26:18 +01:00
parent b8d5ce2542
commit 1874a755a9

View File

@ -158,7 +158,13 @@ class QMs_jsonListView(ListView):
def person(request, slug=""):
"""Now very much simpler with an unambiguous slug
"""
this_person = Person.objects.get(slug=slug)
try:
this_person = Person.objects.get(slug=slug)
except:
msg = f" Person '{slug=}' not found in database. DATABASE RESET required - ask a nerd."
print(msg)
return render(request, "errors/generic.html", {"message": msg})
current_year = current_expo()
return render(request, "person.html", {"person": this_person, "year": current_year})