diff --git a/core/views/statistics.py b/core/views/statistics.py index e344ed2..01e5d2f 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -267,7 +267,10 @@ def stats(request): def dataissues(request): - """Each issue has a parser, a message and a url linking to the offending object after loading""" + """Each issue has a parser, a message and a url linking to the offending object after loading + + This page happens to be the first one looked for, so if the server is offline, this is + where the error happens.""" def myFunc(di): return di.parser.lower() + di.message.lower() @@ -275,7 +278,12 @@ def dataissues(request): dilist = list(DataIssue.objects.all()) dilist.sort(key=myFunc) - return render(request, "dataissues.html", {"didict": dilist, "year": current_expo()}) + try: + return render(request, "dataissues.html", {"didict": dilist, "year": current_expo()}) + except: + message = f'! - Server not online - please wait 5 minutes for database rebuild' + print(message) + return render(request, "errors/generic.html", {"message": message}) def stations(request):