@@ -307,130 +307,6 @@ class Meta:
307307 def clean_approval_text (self ):
308308 return self .cleaned_data ["approval_text" ].replace ("\r " , "" )
309309
310- @group_required ('Area_Director' ,'Secretariat' )
311- def ballot_writeups (request , name ):
312- """Editing of ballot write-ups, sending last calls, ..."""
313- doc = get_object_or_404 (InternetDraft , filename = name )
314- if not doc .idinternal :
315- raise Http404 ()
316-
317- login = IESGLogin .objects .get (login_name = request .user .username )
318-
319- try :
320- ballot = doc .idinternal .ballot
321- except BallotInfo .DoesNotExist :
322- ballot = generate_ballot (request , doc )
323-
324- last_call_form = LastCallTextForm (instance = ballot )
325- ballot_writeup_form = BallotWriteupForm (instance = ballot )
326- approval_text_form = ApprovalTextForm (instance = ballot )
327-
328- if request .method == 'POST' :
329- if "save_last_call_text" in request .POST or "send_last_call_request" in request .POST :
330- last_call_form = LastCallTextForm (request .POST , instance = ballot )
331- if last_call_form .is_valid ():
332- ballot .last_call_text = last_call_form .cleaned_data ["last_call_text" ]
333- ballot .save ()
334-
335- if "send_last_call_request" in request .POST :
336- doc .idinternal .change_state (IDState .objects .get (document_state_id = IDState .LAST_CALL_REQUESTED ), None )
337-
338- change = log_state_changed (request , doc , login )
339- email_owner (request , doc , doc .idinternal .job_owner , login , change )
340- request_last_call (request , doc )
341-
342- doc .idinternal .event_date = date .today ()
343- doc .idinternal .save ()
344-
345- return render_to_response ('idrfc/last_call_requested.html' ,
346- dict (doc = doc ),
347- context_instance = RequestContext (request ))
348-
349- if "regenerate_last_call_text" in request .POST :
350- ballot .last_call_text = generate_last_call_announcement (request , doc )
351- ballot .save ()
352-
353- # make sure form has the updated text
354- last_call_form = LastCallTextForm (instance = ballot )
355-
356- if "save_ballot_writeup" in request .POST :
357- ballot_writeup_form = BallotWriteupForm (request .POST , instance = ballot )
358- if ballot_writeup_form .is_valid ():
359- ballot .ballot_writeup = ballot_writeup_form .cleaned_data ["ballot_writeup" ]
360- ballot .save ()
361-
362- if "issue_ballot" in request .POST :
363- ballot_writeup_form = BallotWriteupForm (request .POST , instance = ballot )
364- approval_text_form = ApprovalTextForm (request .POST , instance = ballot )
365- if ballot_writeup_form .is_valid () and approval_text_form .is_valid ():
366- ballot .ballot_writeup = ballot_writeup_form .cleaned_data ["ballot_writeup" ]
367- ballot .approval_text = approval_text_form .cleaned_data ["approval_text" ]
368- ballot .active = True
369- ballot .ballot_issued = True
370- ballot .save ()
371-
372- if not Position .objects .filter (ballot = ballot , ad = login ):
373- pos = Position ()
374- pos .ballot = ballot
375- pos .ad = login
376- pos .yes = 1
377- pos .noobj = pos .abstain = pos .approve = pos .discuss = pos .recuse = 0
378- pos .save ()
379-
380- msg = generate_issue_ballot_mail (request , doc )
381- send_mail_preformatted (request , msg )
382-
383- email_iana (request , doc , 'drafts-eval@icann.org' , msg )
384-
385- doc .b_sent_date = date .today ()
386- doc .save ()
387-
388- add_document_comment (request , doc , "Ballot has been issued" )
389-
390- doc .idinternal .event_date = date .today ()
391- doc .idinternal .save ()
392-
393- return render_to_response ('idrfc/ballot_issued.html' ,
394- dict (doc = doc ),
395- context_instance = RequestContext (request ))
396-
397-
398- if "save_approval_text" in request .POST :
399- approval_text_form = ApprovalTextForm (request .POST , instance = ballot )
400- if approval_text_form .is_valid ():
401- ballot .approval_text = approval_text_form .cleaned_data ["approval_text" ]
402- ballot .save ()
403-
404- if "regenerate_approval_text" in request .POST :
405- ballot .approval_text = generate_approval_mail (request , doc )
406- ballot .save ()
407-
408- # make sure form has the updated text
409- approval_text_form = ApprovalTextForm (instance = ballot )
410-
411- doc .idinternal .event_date = date .today ()
412- doc .idinternal .save ()
413-
414- can_request_last_call = doc .idinternal .cur_state_id < 27
415- can_make_last_call = doc .idinternal .cur_state_id < 20
416- can_announce = doc .idinternal .cur_state_id > 19
417- docs_with_invalid_status = [d .document ().file_tag () for d in doc .idinternal .ballot_set () if "None" in d .document ().intended_status .intended_status or "Request" in d .document ().intended_status .intended_status ]
418- need_intended_status = ", " .join (docs_with_invalid_status )
419-
420- return render_to_response ('idrfc/ballot_writeups.html' ,
421- dict (doc = doc ,
422- ballot = ballot ,
423- last_call_form = last_call_form ,
424- ballot_writeup_form = ballot_writeup_form ,
425- approval_text_form = approval_text_form ,
426- can_request_last_call = can_request_last_call ,
427- can_make_last_call = can_make_last_call ,
428- can_announce = can_announce ,
429- need_intended_status = need_intended_status ,
430- ),
431- context_instance = RequestContext (request ))
432-
433-
434310@group_required ('Area_Director' ,'Secretariat' )
435311def lastcalltext (request , name ):
436312 """Editing of the last call text"""
0 commit comments