Commit fd378574 authored by Christophe Dumez's avatar Christophe Dumez

- added function that returns preferred username and current username if not set


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7344 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4e2a1a8b
...@@ -540,6 +540,15 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -540,6 +540,15 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
trust_item_list, permanent = loads(b64decode(trust)) trust_item_list, permanent = loads(b64decode(trust))
return dict(trust_item_list), permanent return dict(trust_item_list), permanent
def getPreferredUsername(self):
"""return username in preferences if set of the current username
"""
username = self.getPortalObject().portal_preferences.getPreferredSubversionUserName()
if username is None or username.strip() == "":
# not set in preferences, then we get the current username in zope
username = self.portal_membership.getAuthenticatedMember().getUserName()
return username
def diffHTML(self, file_path, bt, revision1=None, revision2=None): def diffHTML(self, file_path, bt, revision1=None, revision2=None):
raw_diff = self.diff(file_path, bt, revision1, revision2) raw_diff = self.diff(file_path, bt, revision1, revision2)
return DiffFile(raw_diff).toHTML() return DiffFile(raw_diff).toHTML()
......
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