#47 Settings Place Hero when creating a place
This commit is contained in:
parent
a7a3ddfe63
commit
b1cd8fd0cc
@ -18,7 +18,10 @@ 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
|
||||||
form_class = PlaceImageForm
|
form_class = PlaceImageForm
|
||||||
|
Loading…
Reference in New Issue
Block a user