Browse Source

[FIX] Linting

pull/135/head
Rémy Taymans 4 years ago
parent
commit
578208e1e9
  1. 22
      easy_my_coop_website/controllers/main.py

22
easy_my_coop_website/controllers/main.py

@ -7,16 +7,10 @@ from odoo.http import request
from odoo.tools.translate import _
# Only use for behavior, don't stock it
_TECHNICAL = [
"view_from",
"view_callback"
]
_TECHNICAL = ["view_from", "view_callback"]
# transient fields used to compute the address field
_EXTRA_FIELDS = [
"street_name",
"house_number"
]
_EXTRA_FIELDS = ["street_name", "house_number"]
# Allow in description
_BLACKLIST = [
@ -268,7 +262,7 @@ class WebsiteSubscription(http.Controller):
redirect = "easy_my_coop_website.becomecompanycooperator"
email = kwargs.get("company_email")
# TODO: Use a overloaded function with the captcha implementation
if request.website.company_id.captcha_type == 'google':
if request.website.company_id.captcha_type == "google":
if (
"g-recaptcha-response" not in kwargs
or kwargs["g-recaptcha-response"] == ""
@ -422,10 +416,7 @@ class WebsiteSubscription(http.Controller):
and field_name not in _BLACKLIST
):
values[field_name] = field_value
elif (
field_name in _EXTRA_FIELDS
and field_name not in _BLACKLIST
):
elif field_name in _EXTRA_FIELDS and field_name not in _BLACKLIST:
values[field_name] = field_value
# allow to add some free fields or blacklisted field like ID
elif field_name not in _TECHNICAL:
@ -470,7 +461,10 @@ class WebsiteSubscription(http.Controller):
values["share_product_id"] = self.get_selected_share(kwargs).id
values["address"] = kwargs.get("street_name") + ", " + kwargs.get("house_number")
values["address"] = "{street}, {number}".format(
street=kwargs.get("street_name", ""),
number=kwargs.get("house_number", ""),
)
del values["street_name"]
del values["house_number"]

Loading…
Cancel
Save