diff --git a/lostplaces/lostplaces_app/views.py b/lostplaces/lostplaces_app/views.py index 956d89c..970a7d6 100644 --- a/lostplaces/lostplaces_app/views.py +++ b/lostplaces/lostplaces_app/views.py @@ -107,11 +107,19 @@ class PlaceCreateView(IsAuthenticated, View): kwargs_to_pass = { 'pk': place.pk } + + messages.success( + self.request, 'Successfully created place.') return redirect(reverse_lazy('place_detail', kwargs=kwargs_to_pass)) + else: context = { 'form': form_place } + + # Usually the browser should have checked the form before sending. + messages.error( + self.request, 'Please fill in all required fields.') return render(request, 'place/place_create.html', context) def _apply_multipart_image_upload(self, files, place, submitter):