Skip to content

Commit 58e116c

Browse files
committed
Made some submission form validation errors apply to all uploads, not only to .txt uploads. Tweaked som validation error wordings.
- Legacy-Id: 10076
1 parent cd0a482 commit 58e116c

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

ietf/submit/forms.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def clean_xml(self):
116116

117117
def clean(self):
118118
if self.shutdown and not has_role(self.request.user, "Secretariat"):
119-
raise forms.ValidationError('The tool is shut down')
119+
raise forms.ValidationError('The submission tool is currently shut down')
120120

121121
# sanity check that paths exist (for development servers)
122122
for s in ("IDSUBMIT_STAGING_PATH", "IDSUBMIT_IDNITS_BINARY",
@@ -190,7 +190,7 @@ def clean(self):
190190
except forms.ValidationError:
191191
raise
192192
except Exception as e:
193-
raise forms.ValidationError("Exception when trying to process the XML file: %s" % e)
193+
raise forms.ValidationError("An exception occurred when trying to process the XML file: %s" % e)
194194
finally:
195195
os.close(tfh)
196196
os.unlink(tfn)
@@ -205,14 +205,14 @@ def clean(self):
205205
self.title = self.parsed_draft.get_title()
206206
txt_file.seek(0)
207207

208-
if not self.filename:
209-
raise forms.ValidationError("Draft parser could not extract a valid draft name from the upload")
208+
if not self.filename:
209+
raise forms.ValidationError("Could not extract a valid draft name from the upload")
210210

211-
if not self.revision:
212-
raise forms.ValidationError("Draft parser could not extract a valid draft revision from the upload")
211+
if not self.revision:
212+
raise forms.ValidationError("Could not extract a valid draft revision from the upload")
213213

214-
if not self.title:
215-
raise forms.ValidationError("Draft parser could not extract a valid title from the upload")
214+
if not self.title:
215+
raise forms.ValidationError("Could not extract a valid title from the upload")
216216

217217
if self.cleaned_data.get('txt') or self.cleaned_data.get('xml'):
218218
# check group
@@ -221,7 +221,7 @@ def clean(self):
221221
# check existing
222222
existing = Submission.objects.filter(name=self.filename, rev=self.revision).exclude(state__in=("posted", "cancel"))
223223
if existing:
224-
raise forms.ValidationError(mark_safe('Submission with same name and revision is currently being processed. <a href="%s">Check the status here.</a>' % urlreverse("submit_submission_status", kwargs={ 'submission_id': existing[0].pk })))
224+
raise forms.ValidationError(mark_safe('A submission with same name and revision is currently being processed. <a href="%s">Check the status here.</a>' % urlreverse("submit_submission_status", kwargs={ 'submission_id': existing[0].pk })))
225225

226226
# cut-off
227227
if self.revision == '00' and self.in_first_cut_off:

0 commit comments

Comments
 (0)