Skip to content

Commit 750f5e4

Browse files
committed
Tweaked various message strings. Also made the cut-off messages use the actual hour defined in settings, rather than a hardcoded string saying '5 PM (PT)' ...
- Legacy-Id: 3515
1 parent f3d31f0 commit 750f5e4

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

ietf/submit/forms.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,14 @@ def __init__(self, *args, **kwargs):
5151
def read_dates(self):
5252
now = datetime.datetime.utcnow()
5353
first_cut_off = Meeting.get_first_cut_off()
54-
print "first_cut_off:", first_cut_off
5554
second_cut_off = Meeting.get_second_cut_off()
56-
print "second_cut_off:", second_cut_off
5755
ietf_monday = Meeting.get_ietf_monday()
58-
print "ietf_monday:", ietf_monday
5956

6057
if now.date() >= first_cut_off and now.date() < second_cut_off: # We are in the first_cut_off
6158
if now.date() == first_cut_off and now.hour < settings.CUTOFF_HOUR:
62-
self.cutoff_warning = 'The pre-meeting cutoff date for new documents (i.e., version -00 Internet-Drafts) is %s at 5 PM (PT). You will not be able to submit a new document after this time until %s, at midnight' % (first_cut_off, ietf_monday)
59+
self.cutoff_warning = 'The pre-meeting cutoff date for new documents (i.e., version -00 Internet-Drafts) is %s, at %02sh UTC. After that, you will not be able to submit a new document until %s, at %sh UTC' % (first_cut_off, settings.CUTOFF_HOUR, ietf_monday, settings.CUTOFF_HOUR, )
6360
else: # No 00 version allowed
64-
self.cutoff_warning = 'The pre-meeting cutoff date for new documents (i.e., version -00 Internet-Drafts) was %s at 5 PM (PT). You will not be able to submit a new document until %s, at midnight.<br>You can still submit a version -01 or higher Internet-Draft until 5 PM (PT), %s' % (first_cut_off, ietf_monday, second_cut_off)
61+
self.cutoff_warning = 'The pre-meeting cutoff date for new documents (i.e., version -00 Internet-Drafts) was %s at %sh UTC. You will not be able to submit a new document until %s, at %sh UTC.<br>You can still submit a version -01 or higher Internet-Draft until %sh UTC, %s' % (first_cut_off, settings.CUTOFF_HOUR, ietf_monday, settings.CUTOFF_HOUR, settings.CUTOFF_HOUR, second_cut_off, )
6562
self.in_first_cut_off = True
6663
elif now.date() >= second_cut_off and now.date() < ietf_monday:
6764
if now.date() == second_cut_off and now.hour < settings.CUTOFF_HOUR: # We are in the first_cut_off yet
@@ -150,9 +147,9 @@ def check_tresholds(self):
150147
# Same draft by name
151148
same_name = IdSubmissionDetail.objects.filter(filename=filename, revision=revision, submission_date=today)
152149
if same_name.count() > settings.MAX_SAME_DRAFT_NAME:
153-
raise forms.ValidationError('A same I-D cannot be submitted more than %s times a day' % settings.MAX_SAME_DRAFT_NAME)
150+
raise forms.ValidationError('The same I-D cannot be submitted more than %s times a day' % settings.MAX_SAME_DRAFT_NAME)
154151
if sum([i.filesize for i in same_name]) > (settings.MAX_SAME_DRAFT_NAME_SIZE * 1048576):
155-
raise forms.ValidationError('A same I-D submission cannot exceed more than %s MByte a day' % settings.MAX_SAME_DRAFT_NAME_SIZE)
152+
raise forms.ValidationError('The same I-D submission cannot exceed more than %s MByte a day' % settings.MAX_SAME_DRAFT_NAME_SIZE)
156153

157154
# Total from same ip
158155
same_ip = IdSubmissionDetail.objects.filter(remote_ip=remote_ip, submission_date=today)
@@ -165,7 +162,7 @@ def check_tresholds(self):
165162
if self.group:
166163
same_group = IdSubmissionDetail.objects.filter(group_acronym=self.group, submission_date=today)
167164
if same_group.count() > settings.MAX_SAME_WG_DRAFT:
168-
raise forms.ValidationError('A same working group I-Ds cannot be submitted more than %s times a day' % settings.MAX_SAME_WG_DRAFT)
165+
raise forms.ValidationError('The same working group I-Ds cannot be submitted more than %s times a day' % settings.MAX_SAME_WG_DRAFT)
169166
if sum([i.filesize for i in same_group]) > (settings.MAX_SAME_WG_DRAFT_SIZE * 1048576):
170167
raise forms.ValidationError('Total size of same working group I-Ds cannot exceed %s MByte a day' % settings.MAX_SAME_WG_DRAFT_SIZE)
171168

@@ -181,13 +178,13 @@ def check_paths(self):
181178
self.staging_path = getattr(settings, 'IDSUBMIT_STAGING_PATH', None)
182179
self.idnits = getattr(settings, 'IDSUBMIT_IDNITS_BINARY', None)
183180
if not self.staging_path:
184-
raise forms.ValidationError('IDSUBMIT_STAGING_PATH not defined on settings.py')
181+
raise forms.ValidationError('IDSUBMIT_STAGING_PATH not defined in settings.py')
185182
if not os.path.exists(self.staging_path):
186-
raise forms.ValidationError('IDSUBMIT_STAGING_PATH defined on settings.py does not exist')
183+
raise forms.ValidationError('IDSUBMIT_STAGING_PATH defined in settings.py does not exist')
187184
if not self.idnits:
188-
raise forms.ValidationError('IDSUBMIT_IDNITS_BINARY not defined on settings.py')
185+
raise forms.ValidationError('IDSUBMIT_IDNITS_BINARY not defined in settings.py')
189186
if not os.path.exists(self.idnits):
190-
raise forms.ValidationError('IDSUBMIT_IDNITS_BINARY defined on settings.py does not exist')
187+
raise forms.ValidationError('IDSUBMIT_IDNITS_BINARY defined in settings.py does not exist')
191188

192189
def check_previous_submission(self):
193190
filename = self.draft.filename

0 commit comments

Comments
 (0)