Browse Source

[FIX] website_portal_restrict_modification: generic field order

pull/156/head
Vincent Van Rossem 5 years ago
parent
commit
3e235cdcf9
  1. 8
      website_portal_restrict_modification/controllers/main.py

8
website_portal_restrict_modification/controllers/main.py

@ -22,13 +22,13 @@ class CustomerPortalRestrictModification(CustomerPortal):
# since we override mandatory and optional billing fields, # since we override mandatory and optional billing fields,
# parent method will insert the following key/value in `error` dict and `error_message` list, # parent method will insert the following key/value in `error` dict and `error_message` list,
# preventing from saving the form. Workaround is to clear both dict and list.
# preventing from saving the form. Workaround is to remove them from both dict and list.
if ( if (
error.get("common") error.get("common")
and error["common"] == "Unknown field"
and "Unknown field 'name,email,company_name,vat'" in error_message
and error["common"].lower() == "unknown field"
and any("unknown field" in s.lower() for s in error_message)
): ):
error.pop("common") error.pop("common")
error_message.remove("Unknown field 'name,email,company_name,vat'")
error_message = [s for s in error_message if "unknown field" not in s.lower()]
return error, error_message return error, error_message
Loading…
Cancel
Save