Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
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
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
Loading