Allow creation dates that are 3 days after or 3 days before the current date. Fixes #652
- Legacy-Id: 3065
This commit is contained in:
parent
fe466900e1
commit
be0f5e4962
|
@ -392,9 +392,8 @@ class MetaDataForm(AutoPostForm):
|
|||
if not creation_date:
|
||||
return None
|
||||
submit_date = self.draft.submission_date
|
||||
if creation_date > submit_date:
|
||||
raise forms.ValidationError('Creation Date must not be set after submission date')
|
||||
if creation_date + datetime.timedelta(days=3) < submit_date:
|
||||
if (creation_date + datetime.timedelta(days=3) < submit_date or
|
||||
creation_date - datetime.timedelta(days=3) > submit_date):
|
||||
raise forms.ValidationError('Creation Date must be within 3 days of submission date')
|
||||
return creation_date
|
||||
|
||||
|
|
|
@ -233,9 +233,8 @@ class DraftValidation(object):
|
|||
self.add_warning('creation_date', 'Creation Date field is empty or the creation date is not in a proper format')
|
||||
return
|
||||
submit_date = self.draft.submission_date
|
||||
if date > submit_date:
|
||||
self.add_warning('creation_date', 'Creation Date must not be set after submission date')
|
||||
if date + datetime.timedelta(days=3) < submit_date:
|
||||
if (date + datetime.timedelta(days=3) < submit_date or
|
||||
date - datetime.timedelta(days=3) > submit_date):
|
||||
self.add_warning('creation_date', 'Creation Date must be within 3 days of submission date')
|
||||
|
||||
def get_authors(self):
|
||||
|
|
Loading…
Reference in a new issue