OrderExtendForm: Allow to set today

This commit is contained in:
Raphael Michel
2016-12-14 13:53:00 +01:00
parent 24da9b8d85
commit 759fed7a8b

View File

@@ -21,9 +21,9 @@ class ExtendForm(I18nModelForm):
def clean(self):
data = super().clean()
data['expires'] = data['expires'].replace(hour=23, minute=59, second=59)
if data['expires'] < now():
raise ValidationError(_('The new expiry date needs to be in the future.'))
data['expires'] = data['expires'].replace(hour=23, minute=59, second=59)
return data