[gen] Calendar: bugfix; wrapper.appyUser returns the admin if the user is 'System Processes', the virtual user that runs when Zope is starting.
This commit is contained in:
parent
b996de09c6
commit
d45e314ac1
|
@ -310,7 +310,10 @@ class Calendar(Type):
|
|||
currentDate = res[i][0]
|
||||
lastDate = res[i][1]
|
||||
previousDate = res[i-1][0]
|
||||
if previousDate == (currentDate-1):
|
||||
currentType = res[i][2].eventType
|
||||
previousType = res[i-1][2].eventType
|
||||
if (previousDate == (currentDate-1)) and \
|
||||
(previousType == currentType):
|
||||
# A merge is needed
|
||||
del res[i]
|
||||
res[i-1][1] = lastDate or currentDate
|
||||
|
|
|
@ -414,9 +414,9 @@ class ZopeInstaller:
|
|||
self.enableUserTracking()
|
||||
self.configureSessions()
|
||||
self.installBaseObjects()
|
||||
self.installCatalog()
|
||||
# The following line cleans and rebuilds the catalog entirely.
|
||||
#self.app.config.appy().refreshCatalog()
|
||||
self.installCatalog()
|
||||
self.installTool()
|
||||
self.installUi()
|
||||
# Perform migrations if required
|
||||
|
|
|
@ -115,8 +115,11 @@ class AbstractWrapper(object):
|
|||
elif name == 'user':
|
||||
return self.o.getUser()
|
||||
elif name == 'appyUser':
|
||||
return self.search1('User', noSecurity=True,
|
||||
user = self.search1('User', noSecurity=True,
|
||||
login=self.o.getUser().getId())
|
||||
if user: return user
|
||||
if self.o.getUser().getUserName() == 'System Processes':
|
||||
return self.search1('User', noSecurity=True, login='admin')
|
||||
elif name == 'fields': return self.o.getAllAppyTypes()
|
||||
elif name == 'siteUrl': return self.o.getTool().getSiteUrl()
|
||||
# Now, let's try to return a real attribute.
|
||||
|
|
Loading…
Reference in a new issue