Browse Source

Merge pull request #86 from coopiteasy/9.0-fix-company-form-fill-values

[FIX] add calls to fill_values and update values on error
pull/95/head 9.0-2020-05-06.00
Houssine BAKKALI 5 years ago
committed by GitHub
parent
commit
c972d23d7a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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