Merge pull request #254 from levivm/develop

added next url to ssh create key view
This commit is contained in:
Levi Velázquez 2017-05-21 22:36:26 -05:00 committed by GitHub
commit 3d05264d64
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'))