mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Fix program times having no item in clean (#5635)
This error occurs only when adding a program-time form in the frontend and not saving it, but removing it again and then saving the item.
This commit is contained in:
committed by
GitHub
parent
ed43bf327e
commit
313f4f326b
@@ -2311,7 +2311,7 @@ class ItemProgramTime(models.Model):
|
|||||||
end = models.DateTimeField(verbose_name=_("End"))
|
end = models.DateTimeField(verbose_name=_("End"))
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
if self.item.event.has_subevents:
|
if hasattr(self, 'item') and self.item and self.item.event.has_subevents:
|
||||||
raise ValidationError(_("You cannot use program times on an event series."))
|
raise ValidationError(_("You cannot use program times on an event series."))
|
||||||
self.clean_start_end(start=self.start, end=self.end)
|
self.clean_start_end(start=self.start, end=self.end)
|
||||||
super().clean()
|
super().clean()
|
||||||
|
|||||||
Reference in New Issue
Block a user