Really fix 2050c0b7 issue

This commit is contained in:
Raphael Michel
2017-07-16 19:37:18 +02:00
parent 8afff29cd4
commit 1be92f5078
3 changed files with 40 additions and 2 deletions

View File

@@ -381,9 +381,8 @@ class PaymentSettingsForm(SettingsForm):
def clean(self):
cleaned_data = super().clean()
payment_term_last = cleaned_data.get('payment_term_last')
print(payment_term_last)
if payment_term_last and self.obj.presale_end:
if payment_term_last.datetime(self.obj).date() < self.obj.presale_end.date():
if payment_term_last.date(self.obj) < self.obj.presale_end.date():
self.add_error(
'payment_term_last',
_('The last payment date cannot be before the end of presale.'),