summaryrefslogtreecommitdiffstats
path: root/core/views/statistics.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2024-07-23 11:42:36 +0200
committerPhilip Sargent <philip.sargent@gmail.com>2024-07-23 11:42:36 +0200
commita2f4591f725026c224e11ae7f5265546bcf5bba9 (patch)
tree883591849ca9adff57c944e69ac3c7278be78883 /core/views/statistics.py
parent07fc372b4175e683631ba1905526d927a066f97e (diff)
downloadtroggle-a2f4591f725026c224e11ae7f5265546bcf5bba9.tar.gz
troggle-a2f4591f725026c224e11ae7f5265546bcf5bba9.tar.bz2
troggle-a2f4591f725026c224e11ae7f5265546bcf5bba9.zip
offline message
Diffstat (limited to 'core/views/statistics.py')
-rw-r--r--core/views/statistics.py12
1 files changed, 10 insertions, 2 deletions
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):