added next url to ssh create key view

This commit is contained in:
Levi 2017-05-21 22:35:43 -05:00
parent 646f73763e
commit 02a2ac31c6
2 changed files with 6 additions and 2 deletions

View file

@ -113,6 +113,10 @@
{%endif%}
{% if next_url %}
window.location.href = '{{next_url}}'
{% endif %}
{%endblock%}

View file

@ -287,7 +287,6 @@ class GenerateVMSSHKeysView(LoginRequiredMixin, FormView):
form_class = UserHostingKeyForm
model = UserHostingKey
template_name = 'hosting/virtual_machine_key.html'
success_url = reverse_lazy('hosting:orders')
login_url = reverse_lazy('hosting:login')
context_object_name = "virtual_machine"
@ -324,7 +323,8 @@ class GenerateVMSSHKeysView(LoginRequiredMixin, FormView):
context.update({
'private_key': form.cleaned_data.get('private_key'),
'key_name': form.cleaned_data.get('name'),
'form': UserHostingKeyForm(request=self.request)
'form': UserHostingKeyForm(request=self.request),
'next_url': self.request.session.get('next', None)
})
# return HttpResponseRedirect(reverse('hosting:key_pair'))