install: Use Post/Response/Get pattern for reloads

Redirect the POST request for install with the template. This ensures that any
reload performed on the page will be a GET request.

https://en.wikipedia.org/wiki/Post/Redirect/Get

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
Joseph Nuthalapati 2018-08-21 17:49:28 +05:30
parent 27488575c7
commit 61b6395a1c
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35

View File

@ -192,7 +192,10 @@ class SetupView(TemplateView):
# Give a moment for the setup process to start and show
# meaningful status.
time.sleep(1)
return self.render_to_response(self.get_context_data())
response = self.render_to_response(self.get_context_data())
# Post/Response/Get pattern for reloads
response.status_code = 303
return response
elif 'refresh-packages' in request.POST:
# Refresh apt package lists