From a80348923007d849f9174f0578b012577c16c75a Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 16 Dec 2020 15:52:07 +0000 Subject: [PATCH] Change ordering method to work on Django 2.2 --- wagtail_ab_testing/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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))