Formatting

This commit is contained in:
reverend 2020-09-13 20:39:32 +02:00
parent c828d04f05
commit 1a8da002cf

View File

@ -90,23 +90,19 @@ class PlaceCreateView(IsAuthenticatedMixin, View):
submitter=submitter submitter=submitter
) )
kwargs_to_pass = {
'pk': place.pk
}
messages.success( messages.success(
self.request, 'Successfully created place.') self.request,
return redirect(reverse_lazy('place_detail', kwargs=kwargs_to_pass)) 'Successfully created place.'
)
return redirect(reverse_lazy('place_detail', kwargs={'pk': place.pk}))
else: else:
context = {
'form': form_place
}
# Usually the browser should have checked the form before sending. # Usually the browser should have checked the form before sending.
messages.error( messages.error(
self.request, 'Please fill in all required fields.') self.request,
return render(request, 'place/place_create.html', context) 'Please fill in all required fields.'
)
return render(request, 'place/place_create.html', context={'form': form_place})
def _apply_multipart_image_upload(self, files, place, submitter): def _apply_multipart_image_upload(self, files, place, submitter):
for image in files: for image in files: