diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 76f50aec..d76303f7 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -523,13 +523,33 @@ class PaymentOrderView(FormView): else: request.session['customer'] = customer return HttpResponseRedirect( - reverse('datacenterlight:order_confirmation')) + reverse('datacenterlight:add_ssh_key')) else: context = self.get_context_data() context['billing_address_form'] = address_form return self.render_to_response(context) +class AskSSHKeyView(FormView): + form_class = UserHostingKeyForm + template_name = "datacenterlight/add_ssh_key.html" + + def get_form_kwargs(self): + kwargs = super(AskSSHKeyView, self).get_form_kwargs() + kwargs.update({'request': self.request}) + return kwargs + + @cache_control(no_cache=True, must_revalidate=True, no_store=True) + def get(self, request, *args, **kwargs): + context = { + 'site_url': reverse('datacenterlight:index'), + 'cms_integration': get_cms_integration('default'), + 'form': UserHostingKeyForm(request=self.request), + 'keys': get_all_public_keys(self.request.user) + } + return render(request, self.template_name, context) + + class OrderConfirmationView(DetailView, FormView): form_class = UserHostingKeyForm template_name = "datacenterlight/order_detail.html" diff --git a/hosting/templates/hosting/user_key.html b/hosting/templates/hosting/user_key.html index 804d661a..247551b5 100644 --- a/hosting/templates/hosting/user_key.html +++ b/hosting/templates/hosting/user_key.html @@ -8,7 +8,8 @@
{% csrf_token %} {% if messages %}