Browse Source

[FIX] add calls to fill_values and update values on error

pull/86/head
houssine 5 years ago
parent
commit
d6f4434546
  1. 6
      easy_my_coop/controllers/main.py

6
easy_my_coop/controllers/main.py

@ -227,6 +227,8 @@ class WebsiteSubscription(http.Controller):
if email == company_email:
values["error_msg"] = _("Cooperator and company emails"
" should be different.")
values = self.fill_values(values, is_company, logged)
values.update(kwargs)
return request.website.render(redirect, values)
email = company_email
@ -234,6 +236,7 @@ class WebsiteSubscription(http.Controller):
or not request.website.is_captcha_valid(
kwargs['g-recaptcha-response'])):
values = self.fill_values(values, is_company, logged)
values.update(kwargs)
values["error_msg"] = _("the captcha has not been validated,"
" please fill in the captcha")
@ -293,6 +296,7 @@ class WebsiteSubscription(http.Controller):
if not valid:
values = self.fill_values(values, is_company, logged)
values.update(kwargs)
values["error_msg"] = _("You iban account number "
"is not valid")
return request.website.render(redirect, values)
@ -307,6 +311,7 @@ class WebsiteSubscription(http.Controller):
share = self.get_selected_share(kwargs)
if partner.cooperator_type != share.default_code:
values = self.fill_values(values, is_company, logged)
values.update(kwargs)
values["error_msg"] = (_("You can't subscribe two "
"different types of share"))
return request.website.render(redirect, values)
@ -314,6 +319,7 @@ class WebsiteSubscription(http.Controller):
if max_amount > 0 and total_amount > max_amount:
values = self.fill_values(values, is_company, logged)
values.update(kwargs)
values["error_msg"] = (_("You can't subscribe for an amount that "
"exceed ")
+ str(max_amount)

Loading…
Cancel
Save