diff --git a/wagtail_ab_testing/views.py b/wagtail_ab_testing/views.py index a3edc25..d67a190 100644 --- a/wagtail_ab_testing/views.py +++ b/wagtail_ab_testing/views.py @@ -4,7 +4,7 @@ from django import forms from django.core.exceptions import PermissionDenied -from django.db.models import Sum, Q, OrderBy, F +from django.db.models import Sum, Q, F from django.core.serializers.json import DjangoJSONEncoder from django.shortcuts import get_object_or_404, redirect, render from django.template.loader import render_to_string @@ -446,4 +446,4 @@ class AbTestingReportView(ReportView): filterset_class = AbTestingReportFilterSet def get_queryset(self): - return AbTest.objects.all().order_by(OrderBy(F('first_started_at'), descending=True, nulls_first=True)) + return AbTest.objects.all().order_by(F('first_started_at').desc(nulls_first=True))