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