fixed: photo_set.count() raises a Exception when a new Event will be added.

This commit is contained in:
2023-12-31 18:43:01 +01:00
parent dacd6b68c0
commit f1f2473d41

View File

@@ -165,7 +165,7 @@ class Event(models.Model):
self.location = master_event.location self.location = master_event.location
self.url = master_event.url self.url = master_event.url
self.image = self.image or master_event.image self.image = self.image or master_event.image
self.photo_count = self.photo_set.count() self.photo_count = self.photo_set.count() if self.pk else 0
super(Event, self).save(**kwargs) super(Event, self).save(**kwargs)
# Update the Hanchans if necessary: # Update the Hanchans if necessary: