Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ietf/doc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

from django.conf import settings
from django.contrib import messages
from django.db.models import QuerySet
from django.forms import ValidationError
from django.http import Http404
from django.template.loader import render_to_string
from django.utils import timezone
from django.utils.html import escape
from django.urls import reverse as urlreverse

from django_stubs_ext import QuerySetAny

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

if isinstance(events, QuerySet):
if isinstance(events, QuerySetAny):
qs = events.filter(newrevisiondocevent__isnull=False)
else:
qs = NewRevisionDocEvent.objects.filter(doc=doc)
event_revisions = list(qs.order_by('time', 'id').values('id', 'rev', 'time'))

if doc.type_id == "draft" and doc.get_state_slug() == "rfc":
# add fake "RFC" revision
if isinstance(events, QuerySet):
if isinstance(events, QuerySetAny):
e = events.filter(type="published_rfc").order_by('time').last()
else:
e = doc.latest_event(type="published_rfc")
Expand Down