fix: Remove IESG state edit button when state is 'dead' (#6051) (#6065)

This commit is contained in:
Paul Selkirk 2023-08-07 16:14:56 -04:00 committed by GitHub
parent 59c1db196a
commit 638f7ea598
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View file

@ -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 @@ class ChangeStateTests(TestCase):
# 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):

View file

@ -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 @@
</a>
</th>
<td class="edit">
{% if iesg_state.slug != 'idexists' and can_edit %}
{% if iesg_state.slug != 'idexists' and iesg_state.slug != 'dead' and can_edit %}
<a class="btn btn-primary btn-sm"
href="{% url 'ietf.doc.views_draft.change_state' name=doc.name %}">
Edit