Skip to content

Commit

Permalink
Change ordering method to work on Django 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kaedroho committed Dec 16, 2020
1 parent e55b234 commit a803489
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wagtail_ab_testing/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))

0 comments on commit a803489

Please sign in to comment.