Added admin action to make an expired order pending again

This commit is contained in:
Raphael Michel
2016-10-03 11:14:20 +02:00
parent 59e2340529
commit b5a23224c8
7 changed files with 72 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
from django import forms
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from pretix.base.forms import I18nModelForm
@@ -15,6 +16,12 @@ class ExtendForm(I18nModelForm):
'expires': forms.DateTimeInput(attrs={'class': 'datetimepicker'}),
}
def clean(self):
data = super().clean()
if data['expires'] < now():
raise ValidationError(_('The new expiry date needs to be in the future.'))
return data
class ExporterForm(forms.Form):