Commit 996942be authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

zope4: use getId() instead of __str__() for getAuthenticatedMember() value.

because __str__() returns id in Zope2 but returns login in Zope4.
parent 7f49fccf
...@@ -6,7 +6,7 @@ howto_dict = context.Zuite_getHowToInfo() ...@@ -6,7 +6,7 @@ howto_dict = context.Zuite_getHowToInfo()
isTransitionPossible = portal.portal_workflow.isTransitionPossible isTransitionPossible = portal.portal_workflow.isTransitionPossible
# in testExpressUserDocumentationIncomingEvent we relly that loged in user is an ERP5 Person # in testExpressUserDocumentationIncomingEvent we relly that loged in user is an ERP5 Person
logged_in_user = str(context.portal_membership.getAuthenticatedMember()) logged_in_user = context.portal_membership.getAuthenticatedMember().getId()
current_person = context.portal_catalog.getResultValue(portal_type='Person', current_person = context.portal_catalog.getResultValue(portal_type='Person',
reference=logged_in_user) reference=logged_in_user)
if current_person is None: if current_person is None:
......
...@@ -9,7 +9,7 @@ if context.getPriority() != 3: # XXX 3 is Priority.USER ...@@ -9,7 +9,7 @@ if context.getPriority() != 3: # XXX 3 is Priority.USER
return return
for preference in portal.portal_preferences.searchFolder( for preference in portal.portal_preferences.searchFolder(
viewable_owner={'query': str(portal.portal_membership.getAuthenticatedMember()), 'key': 'ExactMatch'}, viewable_owner={'query': portal.portal_membership.getAuthenticatedMember().getId(), 'key': 'ExactMatch'},
portal_type=context.getPortalType()): portal_type=context.getPortalType()):
preference = preference.getObject() preference = preference.getObject()
assert portal.portal_membership.getAuthenticatedMember().allowed(preference, ['Owner', ]), preference assert portal.portal_membership.getAuthenticatedMember().allowed(preference, ['Owner', ]), preference
......
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