Formatting
This commit is contained in:
parent
c828d04f05
commit
1a8da002cf
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user