Commit 5c480b0b authored by Jérome Perrin's avatar Jérome Perrin

credentials: only take into account persons with reference when looking up login from email

also simplify some error messages
parent 4815fa48
......@@ -65,7 +65,7 @@ if choice == "password":\n
portal_preferences = context.portal_preferences\n
result = person_module.searchFolder(reference={\'query\': reference, \'key\': \'ExactMatch\'})\n
if len(result) != 1:\n
portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
portal_status_message = context.Base_translateString("Could not find your user account.")\n
if web_site:\n
return web_site.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
return portal.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
......@@ -96,12 +96,13 @@ if choice == "password":\n
elif choice == "username":\n
query_kw = {"email.url_string" : default_email_text}\n
result = portal.portal_catalog(portal_type="Email", parent_portal_type="Person", **query_kw)\n
if len(result) == 0:\n
portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
person_list = [x.getParentValue() for x in result]\n
person_list = [x for x in result if x.getReference()] # only consider persons with a valid login\n
if len(person_list) == 0:\n
portal_status_message = context.Base_translateString("Could not find your user account.")\n
if web_site:\n
return web_site.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
return portal.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
person_list = [x.getParentValue() for x in result]\n
return context.ERP5Site_newCredentialRecovery(default_email_text=default_email_text, person_list=person_list)\n
</string> </value>
</item>
......
......@@ -1659,9 +1659,6 @@ msgstr "Impossible de trouver l'organisation correspondant à votre login, il n'
msgid "Can't find corresponding person, it's not possible to reset your password."
msgstr "Impossible de trouver la personne correspondant à votre login, il n'est pas possible de réinitialiser votre mot de passe."
msgid "Can't find corresponding person, it's not possible to update your credentials."
msgstr "Impossible de trouver la personne correspondant à votre login, il n'est pas possible de mettre à jour vos informations."
msgid "Cancel"
msgstr "Annuler"
......@@ -2661,6 +2658,9 @@ msgstr "Dénomination sociale"
msgid "Corporate Registration Code"
msgstr "SIRET"
msgid "Could not find your user account."
msgstr "Impossible de trouver votre compte utilisateur."
msgid "Count"
msgstr "Nombre"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment