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 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 = [
|
urlpatterns = [
|
||||||
|
|
|
@ -186,6 +186,7 @@ class BetaProgramView(CreateView):
|
||||||
messages.add_message(self.request, messages.SUCCESS, self.success_message)
|
messages.add_message(self.request, messages.SUCCESS, self.success_message)
|
||||||
return HttpResponseRedirect(self.get_success_url())
|
return HttpResponseRedirect(self.get_success_url())
|
||||||
|
|
||||||
|
|
||||||
class IndexView(CreateView):
|
class IndexView(CreateView):
|
||||||
template_name = "datacenterlight/index.html"
|
template_name = "datacenterlight/index.html"
|
||||||
model = BetaAccess
|
model = BetaAccess
|
||||||
|
@ -307,6 +308,7 @@ class IndexView(CreateView):
|
||||||
messages.add_message(self.request, messages.SUCCESS, self.success_message)
|
messages.add_message(self.request, messages.SUCCESS, self.success_message)
|
||||||
return super(IndexView, self).form_valid(form)
|
return super(IndexView, self).form_valid(form)
|
||||||
|
|
||||||
|
|
||||||
class WhyDataCenterLightView(IndexView):
|
class WhyDataCenterLightView(IndexView):
|
||||||
template_name = "datacenterlight/whydatacenterlight.html"
|
template_name = "datacenterlight/whydatacenterlight.html"
|
||||||
model = BetaAccess
|
model = BetaAccess
|
||||||
|
@ -320,15 +322,16 @@ class WhyDataCenterLightView(IndexView):
|
||||||
'templates': VirtualMachineTemplateSerializer(templates, many=True).data,
|
'templates': VirtualMachineTemplateSerializer(templates, many=True).data,
|
||||||
}
|
}
|
||||||
except:
|
except:
|
||||||
messages.error( request,
|
messages.error(request,
|
||||||
'We have a temporary problem to connect to our backend. \
|
'We have a temporary problem to connect to our backend. \
|
||||||
Please try again in a few minutes'
|
Please try again in a few minutes'
|
||||||
)
|
)
|
||||||
context = {
|
context = {
|
||||||
'error' : 'connection'
|
'error': 'connection'
|
||||||
}
|
}
|
||||||
return render(request, self.template_name, context)
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
|
|
||||||
class PaymentOrderView(FormView):
|
class PaymentOrderView(FormView):
|
||||||
template_name = 'hosting/payment.html'
|
template_name = 'hosting/payment.html'
|
||||||
form_class = BillingAddressForm
|
form_class = BillingAddressForm
|
||||||
|
|
Loading…
Reference in a new issue