@@ -143,45 +143,38 @@ def state_age_colored(doc):
143143 if not doc .get_state_slug () in ["active" , "rfc" ]:
144144 # Don't show anything for expired/withdrawn/replaced drafts
145145 return ""
146- main_state = doc .get_state_slug ('draft-iesg' )
147- if not main_state :
146+ iesg_state = doc .get_state_slug ('draft-iesg' )
147+ if not iesg_state :
148148 return ""
149149
150- if main_state in ["dead" , "watching" , "pub" ]:
150+ if iesg_state in ["dead" , "watching" , "pub" ]:
151151 return ""
152152 try :
153153 state_date = doc .docevent_set .filter (
154- Q (desc__istartswith = "Draft Added by " )|
155- Q (desc__istartswith = "Draft Added in state " )|
156- Q (desc__istartswith = "Draft added in state " )|
157- Q (desc__istartswith = "IESG state changed to " )|
158- Q (desc__istartswith = "State changed to " )|
159- Q (desc__istartswith = "State Changes to " )|
160- Q (desc__istartswith = "Sub state has been changed to " )|
161- Q (desc__istartswith = "State has been changed to " )|
162- Q (desc__istartswith = "IESG process started in state" )
163- ).order_by ('-time' )[0 ].time .date ()
154+ Q (type = "started_iesg_process" )|
155+ Q (type = "changed_state" , statedocevent__state_type = "draft-iesg" )
156+ ).order_by ('-time' )[0 ].time .date ()
164157 except IndexError :
165158 state_date = datetime .date (1990 ,1 ,1 )
166159 days = (datetime .date .today () - state_date ).days
167160 # loosely based on
168161 # http://trac.tools.ietf.org/group/iesg/trac/wiki/PublishPath
169- if main_state == "lc" :
162+ if iesg_state == "lc" :
170163 goal1 = 30
171164 goal2 = 30
172- elif main_state == "rfcqueue" :
165+ elif iesg_state == "rfcqueue" :
173166 goal1 = 60
174167 goal2 = 120
175- elif main_state in ["lc-req" , "ann" ]:
168+ elif iesg_state in ["lc-req" , "ann" ]:
176169 goal1 = 4
177170 goal2 = 7
178171 elif 'need-rev' in [x .slug for x in doc .tags .all ()]:
179172 goal1 = 14
180173 goal2 = 28
181- elif main_state == "pub-req" :
174+ elif iesg_state == "pub-req" :
182175 goal1 = 7
183176 goal2 = 14
184- elif main_state == "ad-eval" :
177+ elif iesg_state == "ad-eval" :
185178 goal1 = 14
186179 goal2 = 28
187180 else :
0 commit comments