@@ -213,7 +213,6 @@ def edit_position(request, name, ballot_id):
213213
214214 if request .method == 'POST' :
215215 old_pos = None
216- # PEY: if not has_role(request.user, "Secretariat") and not pos_by.role_set.filter(name="ad", group__type="area", group__state="active"):
217216 if not has_role (request .user , "Secretariat" ) and not can_ballot (request .user , doc ):
218217 # prevent pre-ADs from voting
219218 return HttpResponseForbidden ("Must be a proper Area Director in an active area or IRSG Member to cast ballot" )
@@ -327,7 +326,6 @@ def build_position_email(pos_by, doc, pos):
327326 pos = pos .pos ,
328327 blocking_name = blocking_name ,
329328 settings = settings ))
330- # PEY: This doesn't work properly for IRSG members, since they don't have the "ad" role. It still manages to get an address so it doesn't have to be fixed as a first priority.
331329 frm = pos_by .role_email ("ad" ).formatted_email ()
332330
333331 if doc .stream_id == "irtf" :
@@ -1090,13 +1088,11 @@ def issue_irsg_ballot(request, name):
10901088 if (duedate == None or duedate == "" ):
10911089 duedate = str (fillerdate )
10921090 e .duedate = datetime .datetime .strptime (duedate , '%Y-%m-%d' )
1093- # PEY: What's the best thing to do for "unreasonable" dates?
10941091 e .type = "created_ballot"
10951092 e .desc = "Created IRSG Ballot"
10961093 ballot_type = BallotType .objects .get (doc_type = doc .type , slug = "irsg-approve" )
10971094 e .ballot_type = ballot_type
10981095 e .save ()
1099- # PEY: This is probably not enough state setting/cleanup. I should review the IESG version more to see what happens.
11001096 new_state = doc .get_state ()
11011097 prev_tags = []
11021098 new_tags = []
@@ -1121,7 +1117,7 @@ def issue_irsg_ballot(request, name):
11211117 else :
11221118 templ = 'doc/ballot/irsg_ballot_approve.html'
11231119
1124- question = "Are you sure you really want to issue a ballot for " + name + "?"
1120+ question = "Confirm issuing a ballot for " + name + "?"
11251121 return render (request , templ , dict (doc = doc ,
11261122 question = question , fillerdate = fillerdate ))
11271123
@@ -1136,43 +1132,16 @@ def close_irsg_ballot(request, name):
11361132 if request .method == 'POST' :
11371133 button = request .POST .__getitem__ ("irsg_button" )
11381134 if button == 'Yes' :
1139- e = BallotDocEvent (doc = doc , rev = doc .rev , by = request .user .person )
1140- e .type = "closed_ballot"
1141- e .desc = "Closed IRSG Ballot"
1142- ballot_type = BallotType .objects .get (doc_type = doc .type , slug = "irsg-approve" )
1143- e .ballot_type = ballot_type
1144- e .save ()
1145- # PEY: This is probably not enough state setting/cleanup. I should review the IESG version more to see what happens.
1146- new_state = doc .get_state ()
1147- prev_tags = []
1148- new_tags = []
1149-
1150- # PEY: Need to determine what the correct state to transition to is.
1151- if doc .type_id == 'draft' :
1152- new_state = State .objects .get (used = True , type = "draft-stream-irtf" , slug = 'active' )
1153-
1154- prev_state = doc .get_state (new_state .type_id if new_state else None )
1155-
1156- doc .set_state (new_state )
1157- doc .tags .remove (* prev_tags )
1158-
1159- events = []
1160- state_change_event = add_state_change_event (doc , by , prev_state , new_state , prev_tags = prev_tags , new_tags = new_tags )
1161- if state_change_event :
1162- events .append (state_change_event )
1163-
1164- if events :
1165- doc .save_with_history (events )
1135+ close_ballot (doc , by , "irsg-approve" )
11661136
11671137 return HttpResponseRedirect (doc .get_absolute_url ())
11681138
11691139 templ = 'doc/ballot/irsg_ballot_close.html'
11701140
1171- question = "Are you sure you really want to close the ballot for " + name + "?"
1141+ question = "Confirm closing the ballot for " + name + "?"
11721142 return render (request , templ , dict (doc = doc ,
11731143 question = question ))
11741144
1175- @role_required ('Secretariat' , 'IRTF Chair' )
11761145def irsg_ballot_status (request ):
11771146 possible_docs = Document .objects .filter (docevent__ballotdocevent__irsgballotdocevent__isnull = False )
11781147 docs = []
@@ -1181,7 +1150,6 @@ def irsg_ballot_status(request):
11811150 ballot = doc .active_ballot ()
11821151 if ballot :
11831152 doc .ballot = ballot
1184- # PEY: Need to figure how to work the duedate into status_columns.html
11851153 # PEY: Also, how is it I can add duedate to doc just like that?
11861154 doc .duedate = datetime .datetime .strftime (ballot .irsgballotdocevent .duedate , '%Y-%m-%d' )
11871155
0 commit comments