Commit 8d25b776 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_authentication_policy: Include a fail safe in case the Login isn't under Person

   Only Person could include getFirstName and getLastName, so implement a fail-safe in case Login is inside a Computer or any other document.


(cherry picked from commit f7694fbc)
parent 0774a0a6
......@@ -69,8 +69,8 @@ if portal.portal_preferences.isPrefferedForceUsernameCheckInPassword():
lower_password = password.lower()
if not is_temp_object:
# real object
first_name = context.getFirstName()
last_name = context.getLastName()
first_name = getattr(context, 'getFirstName', context.getTitle)()
last_name = getattr(context, 'getLastName', context.getReference)()
else:
# temporary object
first_name = getattr(context, 'first_name', None)
......
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