Skip to content

Commit

Permalink
fix: Remove IESG state edit button when state is 'dead' (#6051)
Browse files Browse the repository at this point in the history
  • Loading branch information
pselkirk committed Jul 31, 2023
1 parent 593bdb4 commit b1dd4ef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion ietf/doc/tests_draft.py
Original file line number Diff line number Diff line change
@@ -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 -*-


Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions ietf/templates/doc/document_draft.html
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b1dd4ef

Please sign in to comment.