diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index 5e5b741fe..f5f715162 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -1683,6 +1683,17 @@ class DocTestCase(TestCase): r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=doc.name))) self.assertEqual(r.status_code, 200) + self.assertNotContains(r, "The session for this document was cancelled.") + + SchedulingEvent.objects.create( + session=session, + status_id='canceled', + by = Person.objects.get(user__username="marschairman"), + ) + + r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=doc.name))) + self.assertEqual(r.status_code, 200) + self.assertContains(r, "The session for this document was cancelled.") def test_document_ballot(self): doc = IndividualDraftFactory() diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index d12dd0418..aad45920c 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -870,6 +870,13 @@ def document_main(request, name, rev=None, document_html=False): and doc.group.features.has_nonsession_materials and doc.type_id in doc.group.features.material_types ) + + session_statusid = None + actual_doc = doc if isinstance(doc,Document) else doc.doc + if actual_doc.session_set.count() == 1: + if actual_doc.session_set.get().schedulingevent_set.exists(): + session_statusid = actual_doc.session_set.get().schedulingevent_set.order_by("-time").first().status_id + return render(request, "doc/document_material.html", dict(doc=doc, top=top, @@ -882,6 +889,7 @@ def document_main(request, name, rev=None, document_html=False): can_upload = can_upload, other_types=other_types, presentations=presentations, + session_statusid=session_statusid, )) diff --git a/ietf/templates/doc/document_material.html b/ietf/templates/doc/document_material.html index 7537082df..cf6dd1ab6 100644 --- a/ietf/templates/doc/document_material.html +++ b/ietf/templates/doc/document_material.html @@ -153,6 +153,9 @@ {% endif %}

+ {% if session_statusid == "canceled" %} +
The session for this document was cancelled.
+ {% endif %}
{{ doc.name }}-{{ doc.rev }}