From 86804491e933a9804c2f4c22adec55adce2fd813 Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Thu, 16 Sep 2010 10:47:27 +0000 Subject: [PATCH] Root ERP5 site lacks getRelativeUrl. Add it for consistency so we do not have to add ugly code exceptions in scripts. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38414 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/ERP5Site.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py index 4c3c446623..7840ea6883 100644 --- a/product/ERP5/ERP5Site.py +++ b/product/ERP5/ERP5Site.py @@ -340,6 +340,13 @@ class ERP5Site(FolderMixIn, CMFSite): """ return join(self.getPhysicalPath(),'/') + security.declareProtected(Permissions.AccessContentsInformation, 'getRelativeUrl') + def getRelativeUrl(self): + """ + Returns the url of an object relative to the portal site. + """ + return self.getPortalObject().portal_url.getRelativeUrl(self) + # Old name - for compatibility security.declareProtected(Permissions.AccessContentsInformation, 'getPath') getPath = getUrl -- 2.30.9