Repair the ballot requirements string
- Legacy-Id: 5516
This commit is contained in:
parent
d8c765e72c
commit
fe13ee8dfa
|
@ -592,18 +592,32 @@ class InternetDraft(Document):
|
|||
needed = int((len(ads) - recuse) * 2 / 3)
|
||||
else:
|
||||
# Info and experimental only need one position.
|
||||
needed = 1
|
||||
have = yes + noobj + discuss
|
||||
# Info and experimental without Yes have their full spec now.
|
||||
if yes < 1:
|
||||
return answer.rstrip()
|
||||
else:
|
||||
needed = 1
|
||||
have = yes + noobj
|
||||
if have < needed:
|
||||
more = needed - have
|
||||
if more == 1:
|
||||
answer += "Needs %d more position. " % more
|
||||
answer += "Needs one more YES or NO OBJECTION position "
|
||||
else:
|
||||
answer += "Needs %d more positions. " % more
|
||||
answer += "Needs %d more YES or NO OBJECTION positions " % more
|
||||
if discuss:
|
||||
if discuss == 1:
|
||||
answer += "once the DISCUSS is resolved."
|
||||
else:
|
||||
answer += "once %d DISCUSSes are resolved." % discuss
|
||||
else:
|
||||
answer += ". "
|
||||
else:
|
||||
answer += "Has enough positions to pass"
|
||||
if discuss:
|
||||
answer += " once DISCUSSes are resolved"
|
||||
if discuss == 1:
|
||||
answer += "once the DISCUSS is resolved"
|
||||
else:
|
||||
answer += "once %d DISCUSSes are resolved" % discuss
|
||||
answer += ". "
|
||||
|
||||
return answer.rstrip()
|
||||
|
|
|
@ -59,14 +59,17 @@ def needed_ballot_positions(doc, active_positions):
|
|||
# For standards-track, need positions from 2/3 of the
|
||||
# non-recused current IESG.
|
||||
needed = (len(active_positions) - len(recuse)) * 2 // 3
|
||||
else:
|
||||
if len(yes) < 1:
|
||||
return " ".join(answer)
|
||||
|
||||
have = len(yes) + len(noobj) + len(blocking)
|
||||
have = len(yes) + len(noobj)
|
||||
if have < needed:
|
||||
more = needed - have
|
||||
if more == 1:
|
||||
answer.append("Needs %d more position." % more)
|
||||
answer.append("Needs one more YES or NO OBJECTION position to pass.")
|
||||
else:
|
||||
answer.append("Needs %d more positions." % more)
|
||||
answer.append("Needs %d more YES or NO OBJECTION positions to pass." % more)
|
||||
else:
|
||||
if blocking:
|
||||
answer.append("Has enough positions to pass once %s positions are resolved." % blocking[0].pos.name.upper())
|
||||
|
|
|
@ -516,18 +516,32 @@ class BallotInfo(models.Model): # Added by Michael Lee
|
|||
needed = ( active_iesg.count() - recuse ) * 2 / 3
|
||||
else:
|
||||
# Info and experimental only need one position.
|
||||
needed = 1
|
||||
have = yes + noobj + discuss
|
||||
# Info and experimental without Yes have their full spec now.
|
||||
if yes < 1:
|
||||
return answer.rstrip()
|
||||
else:
|
||||
needed = 1
|
||||
have = yes + noobj
|
||||
if have < needed:
|
||||
more = needed - have
|
||||
if more == 1:
|
||||
answer += "Needs %d more position. " % more
|
||||
answer += "Needs one more position "
|
||||
else:
|
||||
answer += "Needs %d more positions. " % more
|
||||
answer += "Needs %d more positions " % more
|
||||
if discuss:
|
||||
if discuss == 1:
|
||||
answer += "once the DISCUSS is resolved."
|
||||
else:
|
||||
answer += "once %d DISCUSSES are resolved." % discuss
|
||||
else:
|
||||
answer += ". "
|
||||
else:
|
||||
answer += "Has enough positions to pass"
|
||||
if discuss:
|
||||
answer += " once DISCUSSes are resolved"
|
||||
if discuss == 1:
|
||||
answer += " once the DISCUSS is resolved"
|
||||
else:
|
||||
answer += " once %d DISCUSSES are resolved" % discuss
|
||||
answer += ". "
|
||||
|
||||
return answer.rstrip()
|
||||
|
|
Loading…
Reference in a new issue