From ddacfeacf3eeaa9c45286b43ac4d81180006d165 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 7 Jul 2017 01:20:16 +0530 Subject: [PATCH] Fixed some flake8 errors --- datacenterlight/urls.py | 3 ++- datacenterlight/views.py | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/datacenterlight/urls.py b/datacenterlight/urls.py index 33ea644e..a08bacdb 100644 --- a/datacenterlight/urls.py +++ b/datacenterlight/urls.py @@ -1,6 +1,7 @@ from django.conf.urls import url -from .views import IndexView, BetaProgramView, LandingProgramView, BetaAccessView, PricingView, SuccessView, PaymentOrderView, OrderConfirmationView, WhyDataCenterLightView +from .views import IndexView, BetaProgramView, LandingProgramView, BetaAccessView, PricingView, SuccessView, \ + PaymentOrderView, OrderConfirmationView, WhyDataCenterLightView urlpatterns = [ diff --git a/datacenterlight/views.py b/datacenterlight/views.py index e1647228..4c24bfa7 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -186,6 +186,7 @@ class BetaProgramView(CreateView): messages.add_message(self.request, messages.SUCCESS, self.success_message) return HttpResponseRedirect(self.get_success_url()) + class IndexView(CreateView): template_name = "datacenterlight/index.html" model = BetaAccess @@ -307,6 +308,7 @@ class IndexView(CreateView): messages.add_message(self.request, messages.SUCCESS, self.success_message) return super(IndexView, self).form_valid(form) + class WhyDataCenterLightView(IndexView): template_name = "datacenterlight/whydatacenterlight.html" model = BetaAccess @@ -320,14 +322,15 @@ class WhyDataCenterLightView(IndexView): 'templates': VirtualMachineTemplateSerializer(templates, many=True).data, } except: - messages.error( request, - 'We have a temporary problem to connect to our backend. \ - Please try again in a few minutes' - ) + messages.error(request, + 'We have a temporary problem to connect to our backend. \ + Please try again in a few minutes' + ) context = { - 'error' : 'connection' + 'error': 'connection' } - return render(request, self.template_name, context) + return render(request, self.template_name, context) + class PaymentOrderView(FormView): template_name = 'hosting/payment.html'