Skip to content

Commit 8b12a0f

Browse files
committed
Merged in [10591] from housley@vigilsec.com:
Added a negative test to ensure the RFC Editor is not included on notifications of manual posts by the Secretariat unless the document is in the RFC Editor Queue. Also added a directory for staging of manually submitted drafts, instead of using hardcoded /tmp/, and added creation and removal of a test directory for this. - Legacy-Id: 10638 Note: SVN reference [10591] has been migrated to Git commit 4a2868c
2 parents a46289c + 4a2868c commit 8b12a0f

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

ietf/secr/drafts/tests_views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ def setUp(self):
2626
os.mkdir(self.archive_dir)
2727
settings.INTERNET_DRAFT_ARCHIVE_DIR = self.archive_dir
2828

29+
self.manual_dir = os.path.abspath("tmp-submit-manual-dir")
30+
os.mkdir(self.manual_dir)
31+
settings.IDSUBMIT_MANUAL_STAGING_DIR = self.manual_dir
32+
2933
def tearDown(self):
3034
shutil.rmtree(self.repository_dir)
3135
shutil.rmtree(self.archive_dir)
36+
shutil.rmtree(self.manual_dir)
3237

3338
def test_abstract(self):
3439
draft = make_test_data()

ietf/secr/drafts/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def handle_uploaded_file(f):
6969
'''
7070
Save uploaded draft files to temporary directory
7171
'''
72-
destination = open(os.path.join('/tmp', f.name), 'wb+')
72+
destination = open(os.path.join(settings.IDSUBMIT_MANUAL_STAGING_DIR, f.name), 'wb+')
7373
for chunk in f.chunks():
7474
destination.write(chunk)
7575
destination.close()
@@ -155,7 +155,7 @@ def promote_files(draft, types):
155155
'''
156156
filename = '%s-%s' % (draft.name,draft.rev)
157157
for ext in types:
158-
path = os.path.join('/tmp', filename + ext)
158+
path = os.path.join(settings.IDSUBMIT_MANUAL_STAGING_DIR, filename + ext)
159159
shutil.move(path,settings.INTERNET_DRAFT_PATH)
160160

161161
# -------------------------------------------------

ietf/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ def skip_unreadable_post(record):
474474
IDSUBMIT_STAGING_URL = '//www.ietf.org/staging/'
475475
IDSUBMIT_IDNITS_BINARY = '/a/www/ietf-datatracker/scripts/idnits'
476476

477+
IDSUBMIT_MANUAL_STAGING_DIR = '/tmp/'
478+
479+
477480
IDSUBMIT_FILE_TYPES = (
478481
'txt',
479482
'xml',

0 commit comments

Comments
 (0)