Skip to content

Commit 74d3052

Browse files
authored
fix: Include blocked charters in AD dashboard that are in external review (ietf-tools#3689)
1 parent 311bbf8 commit 74d3052

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

ietf/doc/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ class Meta:
8181
ordering = ["type", "order"]
8282

8383
IESG_BALLOT_ACTIVE_STATES = ("lc", "writeupw", "goaheadw", "iesg-eva", "defer")
84+
IESG_CHARTER_ACTIVE_STATES = ("intrev", "extrev", "iesgrev")
85+
IESG_STATCHG_CONFLREV_ACTIVE_STATES = ("iesgeval", "defer")
8486
IESG_SUBSTATE_TAGS = ('ad-f-up', 'need-rev', 'extpty')
8587

8688
class DocumentInfo(models.Model):

ietf/doc/tests.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,21 @@ def test_docs_for_ad(self):
240240
conflrev.set_state(State.objects.get(type='conflrev', slug='iesgeval'))
241241
statchg = DocumentFactory(type_id='statchg',ad=ad)
242242
statchg.set_state(State.objects.get(type='statchg', slug='iesgeval'))
243-
charter = CharterFactory(ad=ad)
243+
charter = CharterFactory(name='charter-ietf-ames',ad=ad)
244244
charter.set_state(State.objects.get(type='charter', slug='iesgrev'))
245245

246246
ballot_type = BallotType.objects.get(doc_type_id='draft',slug='approve')
247247
ballot = BallotDocEventFactory(ballot_type=ballot_type, doc__states=[('draft-iesg','iesg-eva')])
248248
discuss_pos = BallotPositionName.objects.get(slug='discuss')
249249
discuss_other = BallotPositionDocEventFactory(ballot=ballot, doc=ballot.doc, balloter=ad, pos=discuss_pos)
250250

251+
blockedcharter = CharterFactory(name='charter-ietf-mars',ad=ad)
252+
blockedcharter.set_state(State.objects.get(type='charter',slug='extrev'))
253+
charter_ballot_type = BallotType.objects.get(doc_type_id='charter',slug='approve')
254+
charterballot = BallotDocEventFactory(ballot_type=charter_ballot_type, doc__states=[('charter','extrev')])
255+
block_pos = BallotPositionName.objects.get(slug='block')
256+
block_other = BallotPositionDocEventFactory(ballot=charterballot, doc=ballot.doc, balloter=ad, pos=block_pos)
257+
251258
r = self.client.get(urlreverse('ietf.doc.views_search.docs_for_ad', kwargs=dict(name=ad.full_name_as_key())))
252259
self.assertEqual(r.status_code, 200)
253260
self.assertContains(r, draft.name)
@@ -258,6 +265,7 @@ def test_docs_for_ad(self):
258265
self.assertContains(r, charter.name)
259266

260267
self.assertContains(r, discuss_other.doc.name)
268+
self.assertContains(r, block_other.doc.name)
261269

262270
def test_auth48_doc_for_ad(self):
263271
"""Docs in AUTH48 state should have a decoration"""

ietf/doc/views_search.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
import debug # pyflakes:ignore
5252

5353
from ietf.doc.models import ( Document, DocHistory, DocAlias, State,
54-
LastCallDocEvent, NewRevisionDocEvent, IESG_SUBSTATE_TAGS, IESG_BALLOT_ACTIVE_STATES )
54+
LastCallDocEvent, NewRevisionDocEvent, IESG_SUBSTATE_TAGS,
55+
IESG_BALLOT_ACTIVE_STATES, IESG_STATCHG_CONFLREV_ACTIVE_STATES,
56+
IESG_CHARTER_ACTIVE_STATES )
5557
from ietf.doc.fields import select2_id_doc_name_json
5658
from ietf.doc.utils import get_search_cache_key, augment_events_with_revision
5759
from ietf.group.models import Group
@@ -420,9 +422,9 @@ def docs_for_ad(request, name):
420422
possible_docs = Document.objects.filter(Q(states__type="draft-iesg",
421423
states__slug__in=IESG_BALLOT_ACTIVE_STATES) |
422424
Q(states__type="charter",
423-
states__slug__in=("intrev", "iesgrev")) |
425+
states__slug__in=IESG_CHARTER_ACTIVE_STATES) |
424426
Q(states__type__in=("statchg", "conflrev"),
425-
states__slug__in=("iesgeval", "defer")),
427+
states__slug__in=IESG_STATCHG_CONFLREV_ACTIVE_STATES),
426428
docevent__ballotpositiondocevent__pos__blocking=True,
427429
docevent__ballotpositiondocevent__balloter=ad).distinct()
428430
for doc in possible_docs:
@@ -431,7 +433,6 @@ def docs_for_ad(request, name):
431433
continue
432434

433435
blocking_positions = [p for p in ballot.all_positions() if p.pos.blocking]
434-
435436
if not blocking_positions or not any( p.balloter==ad for p in blocking_positions ):
436437
continue
437438

@@ -446,6 +447,10 @@ def docs_for_ad(request, name):
446447
if blocked_docs:
447448
blocked_docs.sort(key=lambda d: min(p.time for p in d.blocking_positions if p.balloter==ad), reverse=True)
448449

450+
for d in blocked_docs:
451+
if d.get_base_name() == 'charter-ietf-shmoo-01-04.txt':
452+
print('Is in list')
453+
449454
return render(request, 'doc/drafts_for_ad.html', {
450455
'form':form, 'docs':results, 'meta':meta, 'ad_name': ad.plain_name(), 'blocked_docs': blocked_docs
451456
})

0 commit comments

Comments
 (0)