Commit 9b81de97 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

erp5_credential: search email address and login with exact match

also add a missing return for Base_redirect.
parent ce44886c
......@@ -71,11 +71,11 @@ document_reference = None\n
if default_email_text is not None:\n
# Case for recovery of username\n
if person_list is None:\n
query_kw = {"email.url_string" : default_email_text}\n
query_kw = {\'email.url_string\':{\'query\':default_email_text, \'key\':\'ExactMatch\'}}\n
result = portal.portal_catalog(portal_type="Email", parent_portal_type="Person", **query_kw)\n
if len(result) == 0:\n
portal_status_message = portal.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
if web_site:\n
if web_site is not None:\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
\n
......@@ -93,11 +93,11 @@ else:\n
# Case for recovery of password\n
if person_list is None:\n
person_module = portal.getDefaultModule(\'Person\')\n
result = person_module.searchFolder(reference=reference)\n
result = person_module.searchFolder(reference={\'query\':reference, \'key\':\'ExactMatch\'})\n
if len(result) != 1:\n
portal_status_message = portal.Base_translateString("Can\'t find corresponding person, it\'s not possible to recover your credentials.")\n
if web_site:\n
web_site.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n
if web_site is not None:\n
return web_site.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n
return portal.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n
\n
person_list = [result[0].getObject(),]\n
......@@ -132,7 +132,7 @@ else:\n
\'reference\': reference}\n
\n
keep_items[\'portal_status_message\'] = portal.Base_translateString(message)\n
if web_site:\n
if web_site is not None:\n
return web_site.Base_redirect(form_id=\'login_form\', keep_items=keep_items)\n
return portal.Base_redirect(form_id=\'login_form\', keep_items=keep_items)\n
</string> </value>
......
erp5_base
erp5_crm
erp5_web
erp5_web
\ No newline at end of file
432
\ No newline at end of file
433
\ No newline at end of file
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