13
13
14
14
from typing import List , Optional # pyflakes:ignore
15
15
16
- from ietf .doc .utils import new_state_change_event , update_action_holders
16
+ from ietf .doc .utils import update_action_holders
17
17
from ietf .utils import log
18
18
from ietf .utils .mail import send_mail
19
- from ietf .doc .models import Document , DocEvent , State , StateDocEvent
19
+ from ietf .doc .models import Document , DocEvent , State
20
20
from ietf .person .models import Person
21
21
from ietf .meeting .models import Meeting
22
22
from ietf .mailtrigger .utils import gather_address_lists
@@ -213,11 +213,11 @@ def splitext(fn):
213
213
214
214
def move_file_to (subdir ):
215
215
# Similar to move_draft_files_to_archive
216
- # ghostlinkd would keep this in the combined all archive since it would
217
- # be sourced from a different place. But when ghostlinkd is removed, nothing
218
- # new is needed here - the file will already exist in the combined archive
219
216
shutil .move (path ,
220
217
os .path .join (settings .INTERNET_DRAFT_ARCHIVE_DIR , subdir , basename ))
218
+ mark = Path (settings .FTP_DIR ) / "internet-drafts" / basename
219
+ if mark .exists ():
220
+ mark .unlink ()
221
221
222
222
try :
223
223
doc = Document .objects .get (name = filename , rev = revision )
@@ -235,41 +235,3 @@ def move_file_to(subdir):
235
235
# All uses of this past 2014 seem related to major system failures.
236
236
move_file_to ("unknown_ids" )
237
237
238
-
239
- def repair_dead_on_expire ():
240
- by = Person .objects .get (name = "(System)" )
241
- id_exists = State .objects .get (type = "draft-iesg" , slug = "idexists" )
242
- dead = State .objects .get (type = "draft-iesg" , slug = "dead" )
243
- dead_drafts = Document .objects .filter (
244
- states__type = "draft-iesg" , states__slug = "dead" , type_id = "draft"
245
- )
246
- for d in dead_drafts :
247
- dead_event = d .latest_event (
248
- StateDocEvent , state_type = "draft-iesg" , state__slug = "dead"
249
- )
250
- if dead_event is not None :
251
- if d .docevent_set .filter (type = "expired_document" ).exists ():
252
- closest_expiry = min (
253
- [
254
- abs (e .time - dead_event .time )
255
- for e in d .docevent_set .filter (type = "expired_document" )
256
- ]
257
- )
258
- if closest_expiry .total_seconds () < 60 :
259
- d .set_state (id_exists )
260
- events = []
261
- e = DocEvent (
262
- doc = d ,
263
- rev = d .rev ,
264
- type = "added_comment" ,
265
- by = by ,
266
- desc = "IESG Dead state was set due only to document expiry - changing IESG state to ID-Exists" ,
267
- )
268
- e .skip_community_list_notification = True
269
- e .save ()
270
- events .append (e )
271
- e = new_state_change_event (d , by , dead , id_exists )
272
- e .skip_community_list_notification = True
273
- e .save ()
274
- events .append (e )
275
- d .save_with_history (events )
0 commit comments