From d8bb051f2356b428c0da3f01ace87f2602ee3199 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 3 Jun 2017 16:03:02 +0200 Subject: [PATCH] Remove unused code --- datacenterlight/views.py | 46 ++++------------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index b68f7408..deae4e3a 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -27,8 +27,8 @@ class PricingView(TemplateView): } except: messages.error( request, - 'We could not load the VM templates due to a backend connection \ - error. Please try again in a few minutes' + 'We have a temporary problem to connect to our backend. \ + Please try again in a few minutes' ) context = { 'error' : 'connection' @@ -36,7 +36,6 @@ class PricingView(TemplateView): return render(request, self.template_name, context) - def post(self, request): cores = request.POST.get('cpu') @@ -54,7 +53,7 @@ class PricingView(TemplateView): if not request.user.is_authenticated(): request.session['next'] = reverse('hosting:payment') - request.session['specs'] = { + request.session['specs'] = { 'cpu':cores, 'memory': memory, 'disk_size': storage, @@ -66,7 +65,7 @@ class PricingView(TemplateView): class BetaAccessView(FormView): template_name = "datacenterlight/beta_access.html" - form_class = BetaAccessForm + form_class = BetaAccessForm success_message = "Thank you, we will contact you as soon as possible" def form_valid(self, form): @@ -151,43 +150,6 @@ class BetaProgramView(CreateView): messages.add_message(self.request, messages.SUCCESS, self.success_message) return HttpResponseRedirect(self.get_success_url()) - # return super(BetaProgramView, self).form_valid(form) - - - - - # def form_valid(self, form): - - # context = { - # 'base_url': "{0}://{1}".format(self.request.scheme, self.request.get_host()) - # } - - # email_data = { - # 'subject': 'DatacenterLight Beta Access Request', - # 'to': form.cleaned_data.get('email'), - # 'context': context, - # 'template_name': 'request_access_confirmation', - # 'template_path': 'datacenterlight/emails/' - # } - # email = BaseEmail(**email_data) - # email.send() - - # context.update({ - # 'email': form.cleaned_data.get('email') - # }) - - # email_data = { - # 'subject': 'DatacenterLight Beta Access Request', - # 'to': 'info@ungleich.ch', - # 'context': context, - # 'template_name': 'request_access_notification', - # 'template_path': 'datacenterlight/emails/' - # } - # email = BaseEmail(**email_data) - # email.send() - - # messages.add_message(self.request, messages.SUCCESS, self.success_message) - # return super(IndexView, self).form_valid(form) class IndexView(CreateView):