From b1dd4ef25fc0dd83ec40e2999024cb0f95a17e35 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Mon, 31 Jul 2023 17:16:59 -0400 Subject: [PATCH] fix: Remove IESG state edit button when state is 'dead' (#6051) --- ietf/doc/tests_draft.py | 20 +++++++++++++++++++- ietf/templates/doc/document_draft.html | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ietf/doc/tests_draft.py b/ietf/doc/tests_draft.py index 5b6dd63b97..85efbf1a6c 100644 --- a/ietf/doc/tests_draft.py +++ b/ietf/doc/tests_draft.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2011-2020, All Rights Reserved +# Copyright The IETF Trust 2011-2023, All Rights Reserved # -*- coding: utf-8 -*- @@ -311,6 +311,24 @@ def test_request_last_call(self): # action holders self.assertCountEqual(draft.action_holders.all(), [ad]) + def test_iesg_state_edit_button(self): + ad = Person.objects.get(user__username="ad") + draft = WgDraftFactory(ad=ad,states=[('draft','active'),('draft-iesg','ad-eval')]) + + url = urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)) + self.client.login(username="ad", password="ad+password") + + r = self.client.get(url) + self.assertEqual(r.status_code, 200) + q = PyQuery(r.content) + self.assertIn("Edit", q('tr:contains("IESG state")').text()) + + draft.set_state(State.objects.get(used=True, type="draft-iesg", slug="dead")) + r = self.client.get(url) + self.assertEqual(r.status_code, 200) + q = PyQuery(r.content) + self.assertNotIn("Edit", q('tr:contains("IESG state")').text()) + class EditInfoTests(TestCase): def test_edit_info(self): diff --git a/ietf/templates/doc/document_draft.html b/ietf/templates/doc/document_draft.html index 62c4120f22..dd1793dca2 100644 --- a/ietf/templates/doc/document_draft.html +++ b/ietf/templates/doc/document_draft.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{# Copyright The IETF Trust 2016-2020, All Rights Reserved #} +{# Copyright The IETF Trust 2016-2023, All Rights Reserved #} {% load origin %} {% load static %} {% load ietf_filters %} @@ -279,7 +279,7 @@ - {% if iesg_state.slug != 'idexists' and can_edit %} + {% if iesg_state.slug != 'idexists' and iesg_state.slug != 'dead' and can_edit %} Edit