From 0b38f1d5bdee9c4e069b5610025f94389e326c2f Mon Sep 17 00:00:00 2001 From: Georg Lehner Date: Mon, 10 Jun 2024 17:27:43 +0200 Subject: [PATCH] Remove superfluous use of Value() in When clause --- helpdesk/views/staff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index fc82263a..f89b5d08 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -20,7 +20,7 @@ from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.core.handlers.wsgi import WSGIRequest from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator -from django.db.models import Q, Case, Value, When +from django.db.models import Q, Case, When from django.forms import HiddenInput, inlineformset_factory, TextInput from django.http import Http404, HttpResponse, HttpResponseRedirect, JsonResponse from django.shortcuts import get_object_or_404, redirect, render @@ -426,8 +426,8 @@ def view_ticket(request, ticket_id): # List open tickets on top dependencies = ticket.ticketdependency.annotate( rank=Case( - When(depends_on__status__in=Ticket.OPEN_STATUSES, then=Value('1')), - default=Value('2') + When(depends_on__status__in=Ticket.OPEN_STATUSES, then=1), + default=2 )).order_by('rank') return render(request, 'helpdesk/ticket.html', {