diff --git a/django_lostplaces/lostplaces/views/place_image_views.py b/django_lostplaces/lostplaces/views/place_image_views.py index dc04c37..fcb82dd 100644 --- a/django_lostplaces/lostplaces/views/place_image_views.py +++ b/django_lostplaces/lostplaces/views/place_image_views.py @@ -18,7 +18,10 @@ class MultiplePlaceImageUploadMixin: submitted_by=submitted_by ) place_image.save() - + if place.hero is None: + place.hero = place.placeimages.all()[0] + place.save() + class PlaceImageCreateView(MultiplePlaceImageUploadMixin, PlaceAssetCreateView): model = PlaceImage form_class = PlaceImageForm