From 1874a755a9d6cd13c0de5959e0f567236b4bf29f Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 21 Apr 2024 20:26:18 +0100 Subject: error message for new person pre database reset --- core/views/logbooks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/views/logbooks.py') 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}) -- cgit v1.2.3