@@ -203,17 +203,6 @@ def move_file(f):
203203 for t in file_types :
204204 move_file ("%s-%s.%s" % (doc .name , doc .rev , t ))
205205
206- # make tombstone
207- new_revision = "%02d" % (int (doc .rev ) + 1 )
208-
209- new_file = open (os .path .join (settings .IDSUBMIT_REPOSITORY_PATH , "%s-%s.txt" % (doc .name , new_revision )), 'w' )
210- txt = render_to_string ("idrfc/expire_textREDESIGN.txt" ,
211- dict (doc = doc ,
212- authors = [(e .get_name (), e .address ) for e in doc .authors .all ()],
213- expire_days = InternetDraft .DAYS_TO_EXPIRE ))
214- new_file .write (txt )
215- new_file .close ()
216-
217206 # now change the state
218207
219208 save_document_in_history (doc )
@@ -233,7 +222,6 @@ def move_file(f):
233222 e .desc = "Document has expired"
234223 e .save ()
235224
236- doc .rev = new_revision # FIXME: incrementing the revision like this is messed up
237225 doc .set_state (State .objects .get (type = "draft" , slug = "expired" ))
238226 doc .time = datetime .datetime .now ()
239227 doc .save ()
@@ -300,7 +288,7 @@ def move_file_to(subdir):
300288
301289def clean_up_id_filesREDESIGN ():
302290 """Move unidentified and old files out of the Internet Draft directory."""
303- cut_off = datetime .date .today () - datetime . timedelta ( days = settings . INTERNET_DRAFT_DAYS_TO_EXPIRE )
291+ cut_off = datetime .date .today ()
304292
305293 pattern = os .path .join (settings .IDSUBMIT_REPOSITORY_PATH , "draft-*.*" )
306294 files = []
@@ -340,21 +328,19 @@ def move_file_to(subdir):
340328 try :
341329 doc = Document .objects .get (name = filename , rev = revision )
342330
343- if doc .get_state_slug () == "rfc" :
331+ state = doc .get_state_slug ()
332+
333+ if state == "rfc" :
344334 if ext != ".txt" :
345335 move_file_to ("unknown_ids" )
346- elif doc .get_state_slug () in ("expired" , "repl" , "auth-rm" , "ietf-rm" ):
347- if doc .expires and doc .expires .date () < cut_off :
348- # Expired, Withdrawn by Author, Replaced, Withdrawn by IETF,
349- # and expired more than DAYS_TO_EXPIRE ago
350- if os .path .getsize (path ) < 1500 :
351- move_file_to ("deleted_tombstones" )
352- # revert version after having deleted tombstone
353- doc .rev = "%02d" % (int (revision ) - 1 ) # FIXME: messed up
354- doc .save ()
355- doc .tags .add (DocTagName .objects .get (slug = 'exp-tomb' ))
356- else :
357- move_file_to ("expired_without_tombstone" )
336+ elif state in ("expired" , "repl" , "auth-rm" , "ietf-rm" ) and doc .expires and doc .expires .date () < cut_off :
337+ # Expired, Replaced, Withdrawn by Author/IETF, and expired
338+ if os .path .getsize (path ) < 1500 :
339+ # we don't make tombstones any more so this should
340+ # go away in the future
341+ move_file_to ("deleted_tombstones" )
342+ else :
343+ move_file_to ("expired_without_tombstone" )
358344
359345 except Document .DoesNotExist :
360346 move_file_to ("unknown_ids" )
0 commit comments