33import datetime
44
55from django .conf import settings
6+ from django .db .models import Q
67
78from ietf .idtracker .models import InternetDraft , DocumentComment , BallotInfo
89from ietf .idrfc .mails import *
910from ietf .idrfc .utils import *
10-
1111from ietf .doc .models import *
1212from ietf .person .models import Person
1313
14+ import debug
15+
1416def request_last_call (request , doc ):
1517 try :
1618 ballot = doc .idinternal .ballot
@@ -46,7 +48,8 @@ def get_expired_last_calls():
4648
4749def get_expired_last_callsREDESIGN ():
4850 today = datetime .date .today ()
49- for d in Document .objects .filter (states__type = "draft-iesg" , states__slug = "lc" ):
51+ for d in Document .objects .filter (Q (states__type = "draft-iesg" , states__slug = "lc" )
52+ | Q (states__type = "statchg" , states__slug = "in-lc" )):
5053 e = d .latest_event (LastCallDocEvent , type = "sent_last_call" )
5154 if e and e .expires .date () <= today :
5255 yield d
@@ -70,17 +73,22 @@ def expire_last_call(doc):
7073 email_last_call_expired (doc )
7174
7275def expire_last_callREDESIGN (doc ):
73- state = State .objects .get (used = True , type = "draft-iesg" , slug = "writeupw" )
74-
75- e = doc .latest_event (WriteupDocEvent , type = "changed_ballot_writeup_text" )
76- if e and "Relevant content can frequently be found in the abstract" not in e .text :
77- # if boiler-plate text has been removed, we assume the
78- # write-up has been written
79- state = State .objects .get (used = True , type = "draft-iesg" , slug = "goaheadw" )
76+ if doc .type_id == 'draft' :
77+ state = State .objects .get (used = True , type = "draft-iesg" , slug = "writeupw" )
78+ e = doc .latest_event (WriteupDocEvent , type = "changed_ballot_writeup_text" )
79+ if e and "Relevant content can frequently be found in the abstract" not in e .text :
80+ # if boiler-plate text has been removed, we assume the
81+ # write-up has been written
82+ state = State .objects .get (used = True , type = "draft-iesg" , slug = "goaheadw" )
83+ prev = doc .get_state ("draft-iesg" )
84+ elif doc .type_id == 'statchg' :
85+ state = State .objects .get (used = True , type = "statchg" , slug = "goahead" )
86+ prev = doc .get_state ("statchg" )
87+ else :
88+ raise ValueError ("Unexpected document type to expire_last_call(): %s" % doc .type )
8089
8190 save_document_in_history (doc )
8291
83- prev = doc .get_state ("draft-iesg" )
8492 doc .set_state (state )
8593
8694 prev_tag = doc .tags .filter (slug__in = IESG_SUBSTATE_TAGS )
@@ -89,7 +97,7 @@ def expire_last_callREDESIGN(doc):
8997 doc .tags .remove (prev_tag )
9098
9199 e = log_state_changed (None , doc , Person .objects .get (name = "(System)" ), prev , prev_tag )
92-
100+
93101 doc .time = e .time
94102 doc .save ()
95103
0 commit comments