Commit 9a808df9 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix error when creating a website : there is no default webmaster. (but I'm also working on it.)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5659 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eb75efc1
...@@ -98,12 +98,15 @@ class WebSite(Domain): ...@@ -98,12 +98,15 @@ class WebSite(Domain):
portal = self.getPortalObject() portal = self.getPortalObject()
# Use the webmaster identity to find documents # Use the webmaster identity to find documents
user = portal.acl_users.getUserById(self.getWebmaster()) user = portal.acl_users.getUserById(self.getWebmaster())
newSecurityManager(get_request(), user) if user is not None:
document = self.WebSite_getDocument(portal, name) newSecurityManager(get_request(), user)
self._v_allow_lookup[name] = document document = self.WebSite_getDocument(portal, name)
setSecurityManager(old_manager) self._v_allow_lookup[name] = document
setSecurityManager(old_manager)
else:
document = None
except: except:
# Cleanup non recursion dict in case of exception # Cleanup non recursion dict in case of exception
if self._v_allow_lookup.has_key(name): del self._v_allow_lookup[name] if self._v_allow_lookup.has_key(name): del self._v_allow_lookup[name]
raise raise
return document return document
\ No newline at end of file
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