From ee80181a5507cbdc848872efc72f37a8f672bc13 Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 24 May 2017 10:58:16 -0500 Subject: [PATCH] added redirect after create vm ssh key --- datacenterlight/views.py | 3 ++ .../hosting/virtual_machine_key.html | 2 +- hosting/views.py | 29 +++++++++++++------ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 3e6a7141..b68f7408 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -51,6 +51,9 @@ class PricingView(TemplateView): request.session['template'] = VirtualMachineTemplateSerializer(template).data + if not request.user.is_authenticated(): + request.session['next'] = reverse('hosting:payment') + request.session['specs'] = { 'cpu':cores, 'memory': memory, diff --git a/hosting/templates/hosting/virtual_machine_key.html b/hosting/templates/hosting/virtual_machine_key.html index 157ceea8..f7780466 100644 --- a/hosting/templates/hosting/virtual_machine_key.html +++ b/hosting/templates/hosting/virtual_machine_key.html @@ -112,7 +112,7 @@ {%endif%} - +{{next_url}} {% if next_url %}