Skip to content

Commit 7ad34ba

Browse files
committed
The logic for displaying 'Email requested to be sent for earlier discuss' on IESG positions was wrong; it would count later discusses and discusses from other ADs as an 'earlier discuss'. Moved any_email_sent() from ballot to position, and refined the criteria.
- Legacy-Id: 16675
1 parent 22e22c2 commit 7ad34ba

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

ietf/doc/models.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,14 +1138,6 @@ def all_positions(self):
11381138
positions.sort(key=lambda p: (p.old_ad, p.ad.last_name()))
11391139
return positions
11401140

1141-
@memoize
1142-
def any_email_sent(self):
1143-
# When the send_email field is introduced, old positions will have it
1144-
# set to None. We sill essentially return True, False, or don't know:
1145-
sent_list = BallotPositionDocEvent.objects.filter(ballot=self, send_email=True).values_list('send_email', flat=True)
1146-
false = any( s==False for s in sent_list )
1147-
true = any( s==True for s in sent_list )
1148-
return True if true else False if false else None
11491141

11501142
class BallotPositionDocEvent(DocEvent):
11511143
ballot = ForeignKey(BallotDocEvent, null=True, default=None) # default=None is a temporary migration period fix, should be removed when charter branch is live
@@ -1157,6 +1149,16 @@ class BallotPositionDocEvent(DocEvent):
11571149
comment_time = models.DateTimeField(help_text="Time optional comment was written", blank=True, null=True)
11581150
send_email = models.NullBooleanField(default=None)
11591151

1152+
@memoize
1153+
def any_email_sent(self):
1154+
# When the send_email field is introduced, old positions will have it
1155+
# set to None. We still essentially return True, False, or don't know:
1156+
sent_list = BallotPositionDocEvent.objects.filter(ballot=self.ballot, time__lte=self.time, ad=self.ad).values_list('send_email', flat=True)
1157+
false = any( s==False for s in sent_list )
1158+
true = any( s==True for s in sent_list )
1159+
return True if true else False if false else None
1160+
1161+
11601162
class WriteupDocEvent(DocEvent):
11611163
text = models.TextField(blank=True)
11621164

ietf/templates/doc/document_ballot_content.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ <h5 class="panel-title">
9595
<b>{{ p.pos.name }}</b> ({{ p.discuss_time|date:"Y-m-d" }}{% if not p.for_current_revision %} for -{{ p.get_dochistory.rev}}{% endif %})
9696
{% if p.send_email %}
9797
<span class="fa fa-envelope-o pull-right" title="Email requested to be sent for this discuss"></span>
98-
{% elif p.ballot.any_email_sent == True %}
98+
{% elif p.any_email_sent == True %}
9999
<span class="fa fa-envelope pull-right" title="Email requested to be sent for earlier discuss"></span>
100-
{% elif p.ballot.any_email_sent == False %}
100+
{% elif p.any_email_sent == False %}
101101
<span class="fa fa-comment-o pull-right" title="No email send requests for this discuss"></span>
102102
{% else %}
103103
<span class="fa fa-comment-o pull-right" title="No email send requests for this discuss"></span>
@@ -116,9 +116,9 @@ <h5 class="panel-title">
116116
<b>Comment</b> ({{ p.comment_time|date:"Y-m-d" }}{% if not p.for_current_revision %} for -{{ p.get_dochistory.rev}}{% endif %})
117117
{% if p.send_email %}
118118
<span class="fa fa-envelope-o pull-right" title="Email requested to be sent for this comment"></span>
119-
{% elif p.ballot.any_email_sent == True %}
119+
{% elif p.any_email_sent == True %}
120120
<span class="fa fa-envelope pull-right" title="Email requested to be sent for earlier comment"></span>
121-
{% elif p.ballot.any_email_sent == False %}
121+
{% elif p.any_email_sent == False %}
122122
<span class="fa fa-comment-o pull-right" title="No email send requests for this comment"></span>
123123
{% else %}
124124
<div class="pull-right small italic" style="margin-top: -0.3em;" title="No ballot position send log available">No email<br/>send info</div>

0 commit comments

Comments
 (0)