Skip to content

Commit 5ed1f62

Browse files
committed
If the announcement hasn't been sent, then use the "old"
algorithm of displaying the current IESG with empty positions for those that haven't been cast yet; if it has been sent then just list the actual positions that are recorded since the database doesn't have any record of whether the positions were for current or old ADs. - Legacy-Id: 636
1 parent 6ca9b6f commit 5ed1f62

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

ietf/idtracker/models.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ class IESGLogin(models.Model):
259259
def __str__(self):
260260
#return "%s, %s" % ( self.last_name, self.first_name)
261261
return "%s %s" % ( self.first_name, self.last_name)
262+
def is_current_ad(self):
263+
return self.user_level == 1
264+
def active_iesg():
265+
return IESGLogin.objects.filter(user_level=1,id__gt=1).order_by('last_name') #XXX hardcoded
266+
active_iesg = staticmethod(active_iesg)
262267
class Meta:
263268
db_table = 'iesg_login'
264269
class Admin:
@@ -416,6 +421,17 @@ def __str__(self):
416421
def remarks(self):
417422
remarks = list(self.discusses.all()) + list(self.comments.all())
418423
return remarks
424+
def active_positions(self):
425+
'''Returns a list of dicts, with AD and Position tuples'''
426+
active_iesg = IESGLogin.active_iesg()
427+
ads = [ad.id for ad in active_iesg]
428+
positions = {}
429+
for position in self.positions.filter(ad__in=ads):
430+
positions[position.ad_id] = position
431+
ret = []
432+
for ad in active_iesg:
433+
ret.append({'ad': ad, 'pos': positions.get(ad.id, None)})
434+
return ret
419435
class Meta:
420436
db_table = 'ballot_info'
421437
class Admin:

ietf/templates/idtracker/ballotinfo_detail.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
Please return the full line with your position.
2121

2222
Yes No-Objection Discuss Abstain
23-
{% for position in object.positions.all|dictsort:"ad.last_name" %}{{ position.ad|ljust:"20" }} {{ position.yes|bracket }} {{ position.noobj|bracket }} {{ position.discuss|bracket }} {{ position.abstain_ind|bracket }}
23+
{% if not object.an_sent %}{% for curpos in object.active_positions %}{{ curpos.ad|ljust:"20" }} {{ curpos.pos.yes|bracket }} {{ curpos.pos.noobj|bracket }} {{ curpos.pos.discuss|bracket }} {{ curpos.pos.abstain_ind|bracket }}
2424
{% endfor %}
25+
{% endif %}{% for position in object.positions.all|dictsort:"ad.last_name" %}{% if object.an_sent or not position.ad.is_current_ad %}{{ position.ad|ljust:"20" }} {{ position.yes|bracket }} {{ position.noobj|bracket }} {{ position.discuss|bracket }} {{ position.abstain_ind|bracket }}
26+
{% endif %}{% endfor %}
2527

2628
"Yes" or "No-Objection" positions from 2/3 of non-recused ADs,
2729
with no "Discuss" positions, are needed for approval.

0 commit comments

Comments
 (0)