Fixed some flake8 warnings
This commit is contained in:
parent
f9c3c80864
commit
f419ce784f
2 changed files with 5 additions and 4 deletions
|
@ -23,9 +23,11 @@ from membership.models import CustomUser, StripeCustomer
|
||||||
from opennebula_api.models import OpenNebulaManager
|
from opennebula_api.models import OpenNebulaManager
|
||||||
from opennebula_api.serializers import VirtualMachineTemplateSerializer, VirtualMachineSerializer
|
from opennebula_api.serializers import VirtualMachineTemplateSerializer, VirtualMachineSerializer
|
||||||
|
|
||||||
|
|
||||||
class LandingProgramView(TemplateView):
|
class LandingProgramView(TemplateView):
|
||||||
template_name = "datacenterlight/landing.html"
|
template_name = "datacenterlight/landing.html"
|
||||||
|
|
||||||
|
|
||||||
class SuccessView(TemplateView):
|
class SuccessView(TemplateView):
|
||||||
template_name = "datacenterlight/success.html"
|
template_name = "datacenterlight/success.html"
|
||||||
|
|
||||||
|
@ -230,14 +232,14 @@ class IndexView(CreateView):
|
||||||
try:
|
try:
|
||||||
name = name_field.clean(name)
|
name = name_field.clean(name)
|
||||||
except ValidationError as err:
|
except ValidationError as err:
|
||||||
msg='{} {}.'.format(name, _('is not a proper name'))
|
msg = '{} {}.'.format(name, _('is not a proper name'))
|
||||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='name')
|
messages.add_message(self.request, messages.ERROR, msg, extra_tags='name')
|
||||||
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
email = email_field.clean(email)
|
email = email_field.clean(email)
|
||||||
except ValidationError as err:
|
except ValidationError as err:
|
||||||
msg='{} {}.'.format(email, _('is not a proper email'))
|
msg = '{} {}.'.format(email, _('is not a proper email'))
|
||||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='email')
|
messages.add_message(self.request, messages.ERROR, msg, extra_tags='email')
|
||||||
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
||||||
|
|
||||||
|
@ -407,7 +409,6 @@ class OrderConfirmationView(DetailView):
|
||||||
billing_address_data = request.session.get('billing_address_data')
|
billing_address_data = request.session.get('billing_address_data')
|
||||||
billing_address_id = request.session.get('billing_address')
|
billing_address_id = request.session.get('billing_address')
|
||||||
billing_address = BillingAddress.objects.filter(id=billing_address_id).first()
|
billing_address = BillingAddress.objects.filter(id=billing_address_id).first()
|
||||||
token = request.session.get('token')
|
|
||||||
vm_template_id = template.get('id', 1)
|
vm_template_id = template.get('id', 1)
|
||||||
final_price = specs.get('price')
|
final_price = specs.get('price')
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,4 @@ class MultipleProxyMiddleware(object):
|
||||||
if field in request.META:
|
if field in request.META:
|
||||||
if ',' in request.META[field]:
|
if ',' in request.META[field]:
|
||||||
parts = request.META[field].split(',')
|
parts = request.META[field].split(',')
|
||||||
request.META[field] = parts[-1].strip()
|
request.META[field] = parts[-1].strip()
|
||||||
|
|
Loading…
Reference in a new issue