Minor cleanup of infoscreen
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user