diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2024-04-21 20:26:18 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2024-04-21 20:26:27 +0100 |
commit | 1874a755a9d6cd13c0de5959e0f567236b4bf29f (patch) | |
tree | 241bb83afd1f421814f638988f43936f6f43863f /core/views/logbooks.py | |
parent | b8d5ce2542d06b1b86241db10e2c1d666f2a33ff (diff) | |
download | troggle-1874a755a9d6cd13c0de5959e0f567236b4bf29f.tar.gz troggle-1874a755a9d6cd13c0de5959e0f567236b4bf29f.tar.bz2 troggle-1874a755a9d6cd13c0de5959e0f567236b4bf29f.zip |
error message for new person pre database reset
Diffstat (limited to 'core/views/logbooks.py')
-rw-r--r-- | core/views/logbooks.py | 8 |
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}) |