Commit cc3cc6e9 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

ERP5Security: fix getPersonByReference should always return a person

parent a63c9cb6
......@@ -134,8 +134,11 @@ class ERP5UserManager(BasePlugin):
cache_factory='erp5_content_short')
person_relative_url = _getPersonRelativeUrlFromReference(reference)
if person_relative_url is not None:
return self.getPortalObject().unrestrictedTraverse(
person = self.getPortalObject().unrestrictedTraverse(
person_relative_url)
if person.getPortalType() == "Person":
return person
return person.getParentValue()
def checkPersonValidity(self, person):
if person.getValidationState() in ('deleted',):
......
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