forked from CGM_Public/pretix_original
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"))
|
||||
|
||||
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."))
|
||||
self.clean_start_end(start=self.start, end=self.end)
|
||||
super().clean()
|
||||
|
||||
Reference in New Issue
Block a user