11import datetime
22import glob
33import os
4- import time
54
65from django .conf import settings
76from django .template .loader import render_to_string
@@ -173,13 +172,11 @@ def get_fullcc_list(draft):
173172def get_email_initial (draft , action = None , input = None ):
174173 """
175174 Takes a draft object, a string representing the email type:
176- (extend,new,replace, resurrect,revision,update,withdraw) and
177- a dictonary of the action form input data (for use with replace, update, extend).
175+ (extend,resurrect,revision,update,withdraw) and
176+ a dictonary of the action form input data (for use with update, extend).
178177 Returns a dictionary containing initial field values for a email notification.
179178 The dictionary consists of to, cc, subject, body.
180179
181- NOTE: for type=new we are listing all authors in the message body to match legacy app.
182- It appears datatracker abbreviates the list with "et al".
183180 """
184181 expiration_date = (datetime .date .today () + datetime .timedelta (185 )).strftime ('%B %d, %Y' )
185182 new_revision = str (int (draft .rev )+ 1 ).zfill (2 )
@@ -196,33 +193,6 @@ def get_email_initial(draft, action=None, input=None):
196193 data ['body' ] = render_to_string ('drafts/message_extend.txt' , context )
197194 data ['expiration_date' ] = input ['expiration_date' ]
198195
199- elif action == 'new' :
200- # if the ID belongs to a group other than "none" add line to message body
201- if draft .group .type .slug == 'wg' :
202- wg_message = 'This draft is a work item of the %s Working Group of the IETF.' % draft .group .name
203- else :
204- wg_message = ''
205- context = {'wg_message' :wg_message ,
206- 'draft' :draft ,
207- 'authors' :get_abbr_authors (draft ),
208- 'revision_date' :draft .latest_event (type = 'new_revision' ).time .date (),
209- 'timestamp' :time .strftime ("%Y-%m-%d%H%M%S" , time .localtime ())}
210- data ['to' ] = 'i-d-announce@ietf.org'
211- data ['cc' ] = draft .group .list_email
212- data ['subject' ] = 'I-D Action: %s' % (curr_filename )
213- data ['body' ] = render_to_string ('drafts/message_new.txt' , context )
214-
215- elif action == 'replace' :
216- '''
217- input['replaced'] is a DocAlias
218- input['replaced_by'] is a Document
219- '''
220- context = {'doc' :input ['replaced' ],'replaced_by' :input ['replaced_by' ]}
221- data ['subject' ] = 'Replacement of %s with %s' % (input ['replaced' ],input ['replaced_by' ])
222- data ['body' ] = render_to_string ('drafts/message_replace.txt' , context )
223- data ['replaced' ] = input ['replaced' ]
224- data ['replaced_by' ] = input ['replaced_by' ]
225-
226196 elif action == 'resurrect' :
227197 last_revision = get_last_revision (draft .name )
228198 last_filename = draft .name + '-' + last_revision + '.txt'
0 commit comments