Skip to content

Commit 3cf5550

Browse files
Merge pull request ietf-tools#5722 from jennifer-richards/queryset-type-check
test: Use QuerySetAny alias for QuerySet type checks
2 parents 1922a60 + 8cd09ab commit 3cf5550

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ietf/doc/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
from django.conf import settings
1919
from django.contrib import messages
20-
from django.db.models import QuerySet
2120
from django.forms import ValidationError
2221
from django.http import Http404
2322
from django.template.loader import render_to_string
2423
from django.utils import timezone
2524
from django.utils.html import escape
2625
from django.urls import reverse as urlreverse
2726

27+
from django_stubs_ext import QuerySetAny
2828

2929
import debug # pyflakes:ignore
3030
from ietf.community.models import CommunityList
@@ -345,15 +345,15 @@ def augment_events_with_revision(doc, events):
345345
"""Take a set of events for doc and add a .rev attribute with the
346346
revision they refer to by checking NewRevisionDocEvents."""
347347

348-
if isinstance(events, QuerySet):
348+
if isinstance(events, QuerySetAny):
349349
qs = events.filter(newrevisiondocevent__isnull=False)
350350
else:
351351
qs = NewRevisionDocEvent.objects.filter(doc=doc)
352352
event_revisions = list(qs.order_by('time', 'id').values('id', 'rev', 'time'))
353353

354354
if doc.type_id == "draft" and doc.get_state_slug() == "rfc":
355355
# add fake "RFC" revision
356-
if isinstance(events, QuerySet):
356+
if isinstance(events, QuerySetAny):
357357
e = events.filter(type="published_rfc").order_by('time').last()
358358
else:
359359
e = doc.latest_event(type="published_rfc")

0 commit comments

Comments
 (0)