Minor cleanup of infoscreen

This commit is contained in:
Aarni Halinen
2018-10-24 20:54:31 +03:00
parent 50268b98a9
commit eb5659d0da
3 changed files with 16 additions and 19 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ from django.shortcuts import render
from django.http import HttpResponse, JsonResponse, HttpResponseBadRequest
from django.views.decorators.http import require_http_methods
from django.conf import settings
from django.db import DatabaseError
from infoscreen.models import Rotation, InfoItem, InfoInstance
from infoscreen.hsl_fetcher import fetch as hsl_fetch
@@ -23,7 +24,7 @@ def default(request, *args, **kwargs):
"""Try getting first rotation item."""
try:
first = Rotation.objects.all()[0].id
except:
except DatabaseError:
first = 0
return index(request, first, *args, **kwargs)