2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00

offline message

This commit is contained in:
Philip Sargent 2024-07-23 11:42:36 +02:00
parent 07fc372b41
commit a2f4591f72

View File

@ -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):