Skip to content

Commit a803489

Browse files
committed
Change ordering method to work on Django 2.2
1 parent e55b234 commit a803489

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wagtail_ab_testing/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from django import forms
66
from django.core.exceptions import PermissionDenied
7-
from django.db.models import Sum, Q, OrderBy, F
7+
from django.db.models import Sum, Q, F
88
from django.core.serializers.json import DjangoJSONEncoder
99
from django.shortcuts import get_object_or_404, redirect, render
1010
from django.template.loader import render_to_string
@@ -446,4 +446,4 @@ class AbTestingReportView(ReportView):
446446
filterset_class = AbTestingReportFilterSet
447447

448448
def get_queryset(self):
449-
return AbTest.objects.all().order_by(OrderBy(F('first_started_at'), descending=True, nulls_first=True))
449+
return AbTest.objects.all().order_by(F('first_started_at').desc(nulls_first=True))

0 commit comments

Comments
 (0)