Commit 39766508 authored by Łukasz Nowak's avatar Łukasz Nowak

- add methods to setting/getting global site id


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34247 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 16d0f04d
......@@ -1268,6 +1268,21 @@ class ERP5Site(FolderMixIn, CMFSite):
key = ('default_activate_parameter', )
return tv.get(key)
security.declareProtected(Permissions.ManagePortal, 'getERP5SiteGlobalId')
def getERP5SiteGlobalId(self):
"""Returns site global ID without any fallback"""
return getattr(self, 'erp5_site_global_id', None)
security.declareProtected(Permissions.ManagePortal, 'setERP5SiteGlobalId')
def setERP5SiteGlobalId(self, global_id):
"""Sets site global ID, only in case if not set yet
Such id should be very big and random, for example uuid version 4, as
defined in RFC 4122.
"""
if self.getERP5SiteGlobalId() in [None, '']:
self.erp5_site_global_id = global_id
Globals.InitializeClass(ERP5Site)
def getBootstrapDirectory():
......
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