Fixed some flake8 errors
This commit is contained in:
parent
1a20507c02
commit
ddacfeacf3
2 changed files with 11 additions and 7 deletions
|
@ -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 = [
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue