summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/views/logbooks.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/views/logbooks.py b/core/views/logbooks.py
index 838595a..6e207ca 100644
--- a/core/views/logbooks.py
+++ b/core/views/logbooks.py
@@ -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})