Always allow to shred empty event series

PRETIXEU-24B
This commit is contained in:
Raphael Michel
2020-05-04 17:24:49 +02:00
parent 19e2158f19
commit 219c82b028

View File

@@ -34,7 +34,7 @@ def shred_constraints(event: Event):
max_fromto=Greatest(Max('date_to'), Max('date_from'))
)
max_date = max_date['max_fromto'] or max_date['max_to'] or max_date['max_from']
if max_date > now() - timedelta(days=60):
if max_date is not None and max_date > now() - timedelta(days=60):
return _('Your event needs to be over for at least 60 days to use this feature.')
else:
if (event.date_to or event.date_from) > now() - timedelta(days=60):