Commit 975906e7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Vincent Pelletier

use getId() instead of __str__.

parent e74c3e3a
......@@ -30,7 +30,7 @@ for entity in ( portal.organisation_module.objectValues() +
# enable preference
ptool = portal.portal_preferences
pref = ptool.accounting_zuite_preference
if pref.owner_info()['id'] != str(context.REQUEST.AUTHENTICATED_USER):
if pref.owner_info()['id'] != context.REQUEST.AUTHENTICATED_USER.getId():
# we have to 'own' the preference for the test
ptool = portal.portal_preferences
# pref.setId('old_accounting_zuite_preference')
......
......@@ -5,7 +5,7 @@ down as less a possible the user interface
"""
from DateTime import DateTime
user_name = str(context.portal_membership.getAuthenticatedMember())
user_name = context.portal_membership.getAuthenticatedMember().getId()
def getUnreadAcknowledgementListForUser(user_name=None):
# We give the portal type "Mass Notification" for now, we can
......
......@@ -71,7 +71,7 @@ if len(where_expression_list):
if parsed_search_string.get('mine', None) is not None:
# user wants only his documents
query_kw['owner'] = str(portal.portal_membership.getAuthenticatedMember())
query_kw['owner'] = portal.portal_membership.getAuthenticatedMember().getId()
# add contributor title
contributor_title = parsed_search_string.get('contributor_title', None)
......
......@@ -18,7 +18,7 @@ if redirect_to_document is None:
redirect_to_document = portal.portal_preferences.isPreferredRedirectToDocument(False)
if user_login is None:
# get current authenticated user
user_login = str(portal.portal_membership.getAuthenticatedMember())
user_login = portal.portal_membership.getAuthenticatedMember().getId()
document_kw = {'user_login': user_login,
'group': group,
......
......@@ -7,7 +7,7 @@
that owner is being indexed.
"""
if user is None:
user = context.portal_membership.getAuthenticatedMember()
user = context.portal_membership.getAuthenticatedMember().getId()
kw['owner'] = user
kw['portal_type'] = context.getPortalMyDocumentTypeList()
......
......@@ -7,7 +7,7 @@
that owner is being indexed.
"""
if user is None:
user = context.portal_membership.getAuthenticatedMember()
user = context.portal_membership.getAuthenticatedMember().getId()
kw['portal_type'] = context.getPortalMyDocumentTypeList()
kw['owner'] = user
......
......@@ -248,7 +248,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [[\'owner\',str(context.portal_membership.getAuthenticatedMember())]]</string> </value>
<value> <string>python: [[\'owner\', context.portal_membership.getAuthenticatedMember().getId()]]</string> </value>
</item>
</dictionary>
</pickle>
......
annotation_list = context.getAnnotation().split('\n');
user_name = context.getPortalObject().portal_membership.getAuthenticatedMember()
user_name = context.getPortalObject().portal_membership.getAuthenticatedMember().getId()
for uid in listbox_uid:
i = int(uid)
old_comment, locator, context_url, author, color = annotation_list[i][1:-1].split("},{");
......
......@@ -48,7 +48,7 @@ def recurseUpdateSyntaxNode(self, node):
elif node.isColumn():
if node.column_name == 'mine':
node.column_name = 'owner'
node.node.value = str(self.portal_membership.getAuthenticatedMember())
node.node.value = self.portal_membership.getAuthenticatedMember().getId()
elif node.column_name == 'state' and node.node.value != 'all':
node.column_name = 'simulation_state'
elif node.column_name == 'type' and node.node.value != 'all':
......
......@@ -56,7 +56,7 @@ DEPRECATION:
<div id="logged_in_as" class="logged_in_as">
<tal:block tal:condition="not: portal/portal_membership/isAnonymousUser">
<span class="logged_txt" i18n:translate="" i18n:domain="ui">Logged In as :</span>
<tal:block tal:replace="python:portal.portal_membership.getAuthenticatedMember().getUserName()" />
<tal:block tal:replace="python:portal.portal_membership.getAuthenticatedMember().getId()" />
</tal:block>
</div>
<p class="clear"></p>
......
......@@ -1425,7 +1425,7 @@ class SelectionTool( BaseTool, SimpleItem ):
user_id = tv.get('_user_id', None)
if user_id is not None:
return user_id
user_id = self.portal_membership.getAuthenticatedMember().getUserName()
user_id = self.portal_membership.getAuthenticatedMember().getId()
tv['_user_id'] = user_id
return user_id
......
......@@ -2478,7 +2478,7 @@ return 1
document.publish()
document.reject()
document.share()
logged_in_user = str(self.portal.portal_membership.getAuthenticatedMember())
logged_in_user = self.portal.portal_membership.getAuthenticatedMember().getId()
event_list = document.Base_getWorkflowEventInfoList()
event_list.reverse()
# all actions by logged in user
......
......@@ -81,7 +81,7 @@ class ERP5CookieCrumblerTests (CookieCrumblerTests):
self.req.traverse('/')
self.assert_(self.req.has_key('AUTHENTICATED_USER'))
self.assertEqual(self.req['AUTHENTICATED_USER'].getUserName(),
self.assertEqual(self.req['AUTHENTICATED_USER'].getId(),
'abrahammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm')
resp = self.req.response
self.assert_(resp.cookies.has_key('__ac'))
......
......@@ -112,8 +112,8 @@ class Subversion(WorkingCopy):
if username:
username = username.strip()
return (username or
# not set in preferences, then we get the current username in zope
portal.portal_membership.getAuthenticatedMember().getUserName())
# not set in preferences, then we get the current user id in zope
portal.portal_membership.getAuthenticatedMember().getId())
def _getClient(self, **kw):
return newSubversionClient(self, **kw)
......
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