aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'views.py')
-rw-r--r--views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/views.py b/views.py
index 5ce9816..c3bcdc2 100644
--- a/views.py
+++ b/views.py
@@ -15,7 +15,6 @@
import datetime
-from django.contrib.postgres.aggregates import ArrayAgg
from django.db import connection
from django.db.models import Count, Max
from django.db.models.expressions import RawSQL
@@ -30,6 +29,9 @@ from .utils import get_current_week, get_current_or_next_week, get_week, group_c
import edt
+if connection.vendor == "postgresql":
+ from django.contrib.postgres.aggregates import ArrayAgg
+
def index(request):
years = Year.objects.order_by("name")
return render(request, "index.html", {"elements": years})