#47 Settings Place Hero when creating a place
This commit is contained in:
parent
a7a3ddfe63
commit
b1cd8fd0cc
@ -18,6 +18,9 @@ class MultiplePlaceImageUploadMixin:
|
|||||||
submitted_by=submitted_by
|
submitted_by=submitted_by
|
||||||
)
|
)
|
||||||
place_image.save()
|
place_image.save()
|
||||||
|
if place.hero is None:
|
||||||
|
place.hero = place.placeimages.all()[0]
|
||||||
|
place.save()
|
||||||
|
|
||||||
class PlaceImageCreateView(MultiplePlaceImageUploadMixin, PlaceAssetCreateView):
|
class PlaceImageCreateView(MultiplePlaceImageUploadMixin, PlaceAssetCreateView):
|
||||||
model = PlaceImage
|
model = PlaceImage
|
||||||
|
Loading…
Reference in New Issue
Block a user