[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]
|
currentDate = res[i][0]
|
||||||
lastDate = res[i][1]
|
lastDate = res[i][1]
|
||||||
previousDate = res[i-1][0]
|
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
|
# A merge is needed
|
||||||
del res[i]
|
del res[i]
|
||||||
res[i-1][1] = lastDate or currentDate
|
res[i-1][1] = lastDate or currentDate
|
||||||
|
|
|
@ -414,9 +414,9 @@ class ZopeInstaller:
|
||||||
self.enableUserTracking()
|
self.enableUserTracking()
|
||||||
self.configureSessions()
|
self.configureSessions()
|
||||||
self.installBaseObjects()
|
self.installBaseObjects()
|
||||||
self.installCatalog()
|
|
||||||
# The following line cleans and rebuilds the catalog entirely.
|
# The following line cleans and rebuilds the catalog entirely.
|
||||||
#self.app.config.appy().refreshCatalog()
|
#self.app.config.appy().refreshCatalog()
|
||||||
|
self.installCatalog()
|
||||||
self.installTool()
|
self.installTool()
|
||||||
self.installUi()
|
self.installUi()
|
||||||
# Perform migrations if required
|
# Perform migrations if required
|
||||||
|
|
|
@ -115,8 +115,11 @@ class AbstractWrapper(object):
|
||||||
elif name == 'user':
|
elif name == 'user':
|
||||||
return self.o.getUser()
|
return self.o.getUser()
|
||||||
elif name == 'appyUser':
|
elif name == 'appyUser':
|
||||||
return self.search1('User', noSecurity=True,
|
user = self.search1('User', noSecurity=True,
|
||||||
login=self.o.getUser().getId())
|
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 == 'fields': return self.o.getAllAppyTypes()
|
||||||
elif name == 'siteUrl': return self.o.getTool().getSiteUrl()
|
elif name == 'siteUrl': return self.o.getTool().getSiteUrl()
|
||||||
# Now, let's try to return a real attribute.
|
# Now, let's try to return a real attribute.
|
||||||
|
|
Loading…
Reference in a new issue