|
17 | 17 |
|
18 | 18 | from django.conf import settings |
19 | 19 | from django.contrib import messages |
20 | | -from django.db.models import QuerySet |
21 | 20 | from django.forms import ValidationError |
22 | 21 | from django.http import Http404 |
23 | 22 | from django.template.loader import render_to_string |
24 | 23 | from django.utils import timezone |
25 | 24 | from django.utils.html import escape |
26 | 25 | from django.urls import reverse as urlreverse |
27 | 26 |
|
| 27 | +from django_stubs_ext import QuerySetAny |
28 | 28 |
|
29 | 29 | import debug # pyflakes:ignore |
30 | 30 | from ietf.community.models import CommunityList |
@@ -345,15 +345,15 @@ def augment_events_with_revision(doc, events): |
345 | 345 | """Take a set of events for doc and add a .rev attribute with the |
346 | 346 | revision they refer to by checking NewRevisionDocEvents.""" |
347 | 347 |
|
348 | | - if isinstance(events, QuerySet): |
| 348 | + if isinstance(events, QuerySetAny): |
349 | 349 | qs = events.filter(newrevisiondocevent__isnull=False) |
350 | 350 | else: |
351 | 351 | qs = NewRevisionDocEvent.objects.filter(doc=doc) |
352 | 352 | event_revisions = list(qs.order_by('time', 'id').values('id', 'rev', 'time')) |
353 | 353 |
|
354 | 354 | if doc.type_id == "draft" and doc.get_state_slug() == "rfc": |
355 | 355 | # add fake "RFC" revision |
356 | | - if isinstance(events, QuerySet): |
| 356 | + if isinstance(events, QuerySetAny): |
357 | 357 | e = events.filter(type="published_rfc").order_by('time').last() |
358 | 358 | else: |
359 | 359 | e = doc.latest_event(type="published_rfc") |
|
0 commit comments