fixed: photo_set.count() raises a Exception when a new Event will be added.
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user