Tweaked a number of setting value names and adjusted one value.
- Legacy-Id: 3037
This commit is contained in:
parent
842b8f428f
commit
fe10dfd20c
|
@ -49,7 +49,7 @@ def send_expire_notice_for_id(doc):
|
|||
|
||||
def expire_id(doc):
|
||||
def move_file(f):
|
||||
src = os.path.join(settings.INTERNET_DRAFT_PATH, f)
|
||||
src = os.path.join(settings.IDSUBMIT_REPOSITORY_PATH, f)
|
||||
dst = os.path.join(settings.INTERNET_DRAFT_ARCHIVE_DIR, f)
|
||||
|
||||
if os.path.exists(src):
|
||||
|
@ -62,7 +62,7 @@ def expire_id(doc):
|
|||
|
||||
new_revision = "%02d" % (int(doc.revision) + 1)
|
||||
|
||||
new_file = open(os.path.join(settings.INTERNET_DRAFT_PATH, "%s-%s.txt" % (doc.filename, new_revision)), 'w')
|
||||
new_file = open(os.path.join(settings.IDSUBMIT_REPOSITORY_PATH, "%s-%s.txt" % (doc.filename, new_revision)), 'w')
|
||||
txt = render_to_string("idrfc/expire_text.txt",
|
||||
dict(doc=doc,
|
||||
authors=[a.person.email() for a in doc.authors.all()],
|
||||
|
@ -87,7 +87,7 @@ def clean_up_id_files():
|
|||
"""Move unidentified and old files out of the Internet Draft directory."""
|
||||
cut_off = datetime.date.today() - datetime.timedelta(days=InternetDraft.DAYS_TO_EXPIRE)
|
||||
|
||||
pattern = os.path.join(settings.INTERNET_DRAFT_PATH, "draft-*.*")
|
||||
pattern = os.path.join(settings.IDSUBMIT_REPOSITORY_PATH, "draft-*.*")
|
||||
files = []
|
||||
filename_re = re.compile('^(.*)-(\d\d)$')
|
||||
|
||||
|
|
|
@ -754,7 +754,7 @@ class ExpireIDsTestCase(django.test.TestCase):
|
|||
os.mkdir(os.path.join(self.archive_dir, "deleted_tombstones"))
|
||||
os.mkdir(os.path.join(self.archive_dir, "expired_without_tombstone"))
|
||||
|
||||
settings.INTERNET_DRAFT_PATH = self.id_dir
|
||||
settings.IDSUBMIT_REPOSITORY_PATH = self.id_dir
|
||||
settings.INTERNET_DRAFT_ARCHIVE_DIR = self.archive_dir
|
||||
|
||||
def tearDown(self):
|
||||
|
|
|
@ -147,7 +147,7 @@ def document_main(request, name, tab):
|
|||
|
||||
(content1, content2) = _get_html(
|
||||
str(name)+","+str(id.revision)+",html",
|
||||
os.path.join(settings.INTERNET_DRAFT_PATH, name+"-"+id.revision+".txt"))
|
||||
os.path.join(settings.IDSUBMIT_REPOSITORY_PATH, name+"-"+id.revision+".txt"))
|
||||
|
||||
versions = _get_versions(id)
|
||||
history = _get_history(doc, versions)
|
||||
|
|
|
@ -314,7 +314,7 @@ def telechat_docs_tarfile(request,year,month,day):
|
|||
mfh, mfn = mkstemp()
|
||||
manifest = open(mfn, "w")
|
||||
for doc in docs:
|
||||
doc_path = os.path.join(settings.INTERNET_DRAFT_PATH, doc.draft.filename+"-"+doc.draft.revision_display()+".txt")
|
||||
doc_path = os.path.join(settings.IDSUBMIT_REPOSITORY_PATH, doc.draft.filename+"-"+doc.draft.revision_display()+".txt")
|
||||
if os.path.exists(doc_path):
|
||||
try:
|
||||
tarstream.add(doc_path, str(doc.draft.filename+"-"+doc.draft.revision_display()+".txt"))
|
||||
|
|
|
@ -168,7 +168,7 @@ def session_agenda(request, num, session, ext=None):
|
|||
|
||||
def convert_to_pdf(doc_name):
|
||||
import subprocess
|
||||
inpath = os.path.join(settings.INTERNET_DRAFT_PATH, doc_name + ".txt")
|
||||
inpath = os.path.join(settings.IDSUBMIT_REPOSITORY_PATH, doc_name + ".txt")
|
||||
outpath = os.path.join(settings.INTERNET_DRAFT_PDF_PATH, doc_name + ".pdf")
|
||||
|
||||
try:
|
||||
|
|
|
@ -194,16 +194,18 @@ LIAISON_ATTACH_PATH = '/a/www/ietf-datatracker/documents/LIAISON/'
|
|||
LIAISON_ATTACH_URL = '/documents/LIAISON/'
|
||||
|
||||
# ID Submission Tool settings
|
||||
IDST_FROM_EMAIL = 'IETF I-D Submission Tool <idsubmission@ietf.org>'
|
||||
IDST_TO_EMAIL = 'internet-drafts@ietf.org'
|
||||
IDSUBMIT_FROM_EMAIL = 'IETF I-D Submission Tool <idsubmission@ietf.org>'
|
||||
IDSUBMIT_TO_EMAIL = 'internet-drafts@ietf.org'
|
||||
|
||||
# Days from meeting to cut off dates on submit
|
||||
FIRST_CUTOFF_DAYS = 5
|
||||
SECOND_CUTOFF_DAYS = 3
|
||||
|
||||
STAGING_PATH = '/a/www/www6s/staging/'
|
||||
STAGING_URL = 'http://www.ietf.org/staging/'
|
||||
IDNITS_PATH = '/a/www/ietf-datatracker/release/idnits'
|
||||
IDSUBMIT_REPOSITORY_PATH = INTERNET_DRAFT_PATH
|
||||
IDSUBMIT_STAGING_PATH = '/a/www/www6s/staging/'
|
||||
IDSUBMIT_STAGING_URL = 'http://www.ietf.org/staging/'
|
||||
IDSUBMIT_IDNITS_BINARY = '/a/www/ietf-datatracker/scripts/idnits'
|
||||
|
||||
MAX_PLAIN_DRAFT_SIZE = 6291456 # Max size of the txt draft in bytes
|
||||
|
||||
# DOS THRESHOLDS PER DAY (Sizes are in MB)
|
||||
|
|
|
@ -178,16 +178,16 @@ class UploadForm(forms.Form):
|
|||
raise forms.ValidationError('The total size of today\'s submission has reached the maximum size of submission per day')
|
||||
|
||||
def check_paths(self):
|
||||
self.staging_path = getattr(settings, 'STAGING_PATH', None)
|
||||
self.idnits = getattr(settings, 'IDNITS_PATH', None)
|
||||
self.staging_path = getattr(settings, 'IDSUBMIT_STAGING_PATH', None)
|
||||
self.idnits = getattr(settings, 'IDSUBMIT_IDNITS_BINARY', None)
|
||||
if not self.staging_path:
|
||||
raise forms.ValidationError('STAGING_PATH not defined on settings.py')
|
||||
raise forms.ValidationError('IDSUBMIT_STAGING_PATH not defined on settings.py')
|
||||
if not os.path.exists(self.staging_path):
|
||||
raise forms.ValidationError('STAGING_PATH defined on settings.py does not exist')
|
||||
raise forms.ValidationError('IDSUBMIT_STAGING_PATH defined on settings.py does not exist')
|
||||
if not self.idnits:
|
||||
raise forms.ValidationError('IDNITS_PATH not defined on settings.py')
|
||||
raise forms.ValidationError('IDSUBMIT_IDNITS_BINARY not defined on settings.py')
|
||||
if not os.path.exists(self.idnits):
|
||||
raise forms.ValidationError('IDNITS_PATH defined on settings.py does not exist')
|
||||
raise forms.ValidationError('IDSUBMIT_IDNITS_BINARY defined on settings.py does not exist')
|
||||
|
||||
def check_previous_submission(self):
|
||||
filename = self.draft.filename
|
||||
|
@ -315,7 +315,7 @@ class AutoPostForm(forms.Form):
|
|||
|
||||
def send_confirmation_mail(self, request):
|
||||
subject = 'Confirmation for Auto-Post of I-D %s' % self.draft.filename
|
||||
from_email = settings.IDST_FROM_EMAIL
|
||||
from_email = settings.IDSUBMIT_FROM_EMAIL
|
||||
to_email = self.cleaned_data['email']
|
||||
send_mail(request, to_email, from_email, subject, 'submit/confirm_autopost.txt',
|
||||
{'draft': self.draft, 'domain': Site.objects.get_current().domain })
|
||||
|
@ -432,8 +432,8 @@ class MetaDataForm(AutoPostForm):
|
|||
def move_docs(self, draft, revision):
|
||||
old_revision = draft.revision
|
||||
for ext in draft.file_type.split(','):
|
||||
source = os.path.join(settings.STAGING_PATH, '%s-%s%s' % (draft.filename, old_revision, ext))
|
||||
dest = os.path.join(settings.STAGING_PATH, '%s-%s%s' % (draft.filename, revision, ext))
|
||||
source = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s%s' % (draft.filename, old_revision, ext))
|
||||
dest = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s%s' % (draft.filename, revision, ext))
|
||||
os.rename(source, dest)
|
||||
|
||||
def save_new_draft_info(self):
|
||||
|
@ -456,8 +456,8 @@ class MetaDataForm(AutoPostForm):
|
|||
|
||||
def send_mail_to_secretariat(self, request):
|
||||
subject = 'Manual Post Requested for %s' % self.draft.filename
|
||||
from_email = settings.IDST_FROM_EMAIL
|
||||
to_email = settings.IDST_TO_EMAIL
|
||||
from_email = settings.IDSUBMIT_FROM_EMAIL
|
||||
to_email = settings.IDSUBMIT_TO_EMAIL
|
||||
cc = [self.cleaned_data['email']]
|
||||
cc += [i['email'][1] for i in self.authors]
|
||||
if self.draft.group_acronym:
|
||||
|
|
|
@ -11,10 +11,10 @@ register = template.Library()
|
|||
def show_submission_files(context, submission):
|
||||
result = []
|
||||
for ext in submission.file_type.split(','):
|
||||
source = os.path.join(settings.STAGING_PATH, '%s-%s%s' % (submission.filename, submission.revision, ext))
|
||||
source = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s%s' % (submission.filename, submission.revision, ext))
|
||||
if os.path.exists(source):
|
||||
result.append({'name': '[%s version ]' % ext[1:].capitalize(),
|
||||
'url': '%s%s-%s%s' % (settings.STAGING_URL, submission.filename, submission.revision, ext)})
|
||||
'url': '%s%s-%s%s' % (settings.IDSUBMIT_STAGING_URL, submission.filename, submission.revision, ext)})
|
||||
return {'files': result}
|
||||
|
||||
def show_two_pages(context, two_pages, validation):
|
||||
|
|
|
@ -26,7 +26,7 @@ NONE_WG = 1027
|
|||
|
||||
def request_full_url(request, submission):
|
||||
subject = 'Full url for managing submission of draft %s' % submission.filename
|
||||
from_email = settings.IDST_FROM_EMAIL
|
||||
from_email = settings.IDSUBMIT_FROM_EMAIL
|
||||
to_email = ['%s <%s>' % i.email() for i in submission.tempidauthors_set.all()]
|
||||
send_mail(request, to_email, from_email, subject, 'submit/request_full_url.txt',
|
||||
{'submission': submission,
|
||||
|
@ -142,14 +142,14 @@ def is_secretariat(user):
|
|||
|
||||
def move_docs(submission):
|
||||
for ext in submission.file_type.split(','):
|
||||
source = os.path.join(settings.STAGING_PATH, '%s-%s%s' % (submission.filename, submission.revision, ext))
|
||||
dest = os.path.join(settings.INTERNET_DRAFT_PATH, '%s-%s%s' % (submission.filename, submission.revision, ext))
|
||||
source = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s%s' % (submission.filename, submission.revision, ext))
|
||||
dest = os.path.join(settings.IDSUBMIT_REPOSITORY_PATH, '%s-%s%s' % (submission.filename, submission.revision, ext))
|
||||
os.rename(source, dest)
|
||||
|
||||
|
||||
def remove_docs(submission):
|
||||
for ext in submission.file_type.split(','):
|
||||
source = os.path.join(settings.STAGING_PATH, '%s-%s%s' % (submission.filename, submission.revision, ext))
|
||||
source = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s%s' % (submission.filename, submission.revision, ext))
|
||||
if os.path.exists(source):
|
||||
os.unlink(source)
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ def draft_status(request, submission_id, submission_hash=None, message=None):
|
|||
if detail.revision == '00' and not approved_detail:
|
||||
submitter = auto_post_form.save_submitter_info()
|
||||
subject = 'New draft waiting for approval: %s' % detail.filename
|
||||
from_email = settings.IDST_FROM_EMAIL
|
||||
from_email = settings.IDSUBMIT_FROM_EMAIL
|
||||
to_email = []
|
||||
if detail.group_acronym:
|
||||
to_email += [i.person.email()[1] for i in detail.group_acronym.wgchair_set.all()]
|
||||
|
|
Loading…
Reference in a new issue