33import datetime
44
55from django .conf import settings
6- from django .db .models import Q
76
8- from ietf .idtracker .models import InternetDraft , DocumentComment , BallotInfo
9- from ietf .idrfc .mails import *
10- from ietf .idrfc .utils import *
117from ietf .doc .models import *
128from ietf .person .models import Person
13-
14- import debug
9+ from ietf . doc . utils import log_state_changed
10+ from ietf . doc . mails import *
1511
1612def request_last_call (request , doc ):
17- try :
18- ballot = doc .idinternal .ballot
19- except BallotInfo .DoesNotExist :
20- ballot = generate_ballot (request , doc )
21-
22- send_last_call_request (request , doc , ballot )
23- add_document_comment (request , doc , "Last Call was requested" )
24-
25- def request_last_callREDESIGN (request , doc ):
2613 if not doc .latest_event (type = "changed_ballot_writeup_text" ):
2714 generate_ballot_writeup (request , doc )
2815 if not doc .latest_event (type = "changed_ballot_approval_text" ):
@@ -39,14 +26,7 @@ def request_last_callREDESIGN(request, doc):
3926 e .desc = "Last call was requested"
4027 e .save ()
4128
42- if settings .USE_DB_REDESIGN_PROXY_CLASSES :
43- request_last_call = request_last_callREDESIGN
44-
4529def get_expired_last_calls ():
46- return InternetDraft .objects .filter (lc_expiration_date__lte = datetime .date .today (),
47- idinternal__cur_state__document_state_id = IDState .IN_LAST_CALL )
48-
49- def get_expired_last_callsREDESIGN ():
5030 today = datetime .date .today ()
5131 for d in Document .objects .filter (Q (states__type = "draft-iesg" , states__slug = "lc" )
5232 | Q (states__type = "statchg" , states__slug = "in-lc" )):
@@ -55,24 +35,6 @@ def get_expired_last_callsREDESIGN():
5535 yield d
5636
5737def expire_last_call (doc ):
58- state = IDState .WAITING_FOR_WRITEUP
59-
60- try :
61- ballot = doc .idinternal .ballot
62- if ballot .ballot_writeup and "Relevant content can frequently be found in the abstract" not in ballot .ballot_writeup :
63- state = IDState .WAITING_FOR_AD_GO_AHEAD
64- except BallotInfo .DoesNotExist :
65- pass
66-
67- doc .idinternal .change_state (IDState .objects .get (document_state_id = state ), None )
68- doc .idinternal .event_date = datetime .date .today ()
69- doc .idinternal .save ()
70-
71- log_state_changed (None , doc , by = "system" , email_watch_list = False )
72-
73- email_last_call_expired (doc )
74-
75- def expire_last_callREDESIGN (doc ):
7638 if doc .type_id == 'draft' :
7739 state = State .objects .get (used = True , type = "draft-iesg" , slug = "writeupw" )
7840 e = doc .latest_event (WriteupDocEvent , type = "changed_ballot_writeup_text" )
@@ -87,23 +49,19 @@ def expire_last_callREDESIGN(doc):
8749 else :
8850 raise ValueError ("Unexpected document type to expire_last_call(): %s" % doc .type )
8951
90- save_document_in_history ( doc )
52+ prev_state = doc . friendly_state ( )
9153
54+ save_document_in_history (doc )
9255 doc .set_state (state )
9356
9457 prev_tag = doc .tags .filter (slug__in = IESG_SUBSTATE_TAGS )
9558 prev_tag = prev_tag [0 ] if prev_tag else None
9659 if prev_tag :
9760 doc .tags .remove (prev_tag )
9861
99- e = log_state_changed (None , doc , Person .objects .get (name = "(System)" ), prev , prev_tag )
100-
62+ e = log_state_changed (None , doc , Person .objects .get (name = "(System)" ), doc . friendly_state (), prev_state )
63+
10164 doc .time = e .time
10265 doc .save ()
10366
10467 email_last_call_expired (doc )
105-
106- if settings .USE_DB_REDESIGN_PROXY_CLASSES :
107- get_expired_last_calls = get_expired_last_callsREDESIGN
108- expire_last_call = expire_last_callREDESIGN
109-
0 commit comments