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
)
kwargs_to_pass = {
'pk': place.pk
}
messages.success(
self.request, 'Successfully created place.')
return redirect(reverse_lazy('place_detail', kwargs=kwargs_to_pass))
self.request,
'Successfully created place.'
)
return redirect(reverse_lazy('place_detail', kwargs={'pk': place.pk}))
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)
self.request,
'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):
for image in files: