Commit cb4a7c68 authored by Rafael Monnerat's avatar Rafael Monnerat

ERP5LoginUserManager: Check Assignment is only meaninfull for Persons

parent 88fa33d0
...@@ -113,16 +113,17 @@ class ERP5LoginUserManager(BasePlugin): ...@@ -113,16 +113,17 @@ class ERP5LoginUserManager(BasePlugin):
return return
if user_value.getValidationState() == 'deleted': if user_value.getValidationState() == 'deleted':
return return
now = DateTime() if user_value.getPortalType() in ('Person', ):
for assignment in user_value.contentValues(portal_type="Assignment"): now = DateTime()
if assignment.getValidationState() == "open" and ( for assignment in user_value.contentValues(portal_type="Assignment"):
not assignment.hasStartDate() or assignment.getStartDate() <= now if assignment.getValidationState() == "open" and (
) and ( not assignment.hasStartDate() or assignment.getStartDate() <= now
not assignment.hasStopDate() or assignment.getStopDate() >= now ) and (
): not assignment.hasStopDate() or assignment.getStopDate() >= now
break ):
else: break
return else:
return
is_authentication_policy_enabled = self.getPortalObject().portal_preferences.isAuthenticationPolicyEnabled() is_authentication_policy_enabled = self.getPortalObject().portal_preferences.isAuthenticationPolicyEnabled()
if check_password: if check_password:
password = credentials.get('password') password = credentials.get('password')
......
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