[gen] Adapted all logged messages because thhe logged user is now automatically prepended to any message.

This commit is contained in:
Gaetan Delannay 2014-09-01 14:14:32 +02:00
parent ac1d710288
commit 7889277328
5 changed files with 21 additions and 19 deletions

View file

@ -659,7 +659,7 @@ class ToolWrapper(AbstractWrapper):
convScript = '%s/pod/converter.py' % os.path.dirname(appy.__file__)
cmd = '%s %s "%s" %s -p%d' % (self.unoEnabledPython, convScript,
fileName, format, self.openOfficePort)
self.log('Executing %s...' % cmd)
self.log('executing %s...' % cmd)
return executeCommand(cmd) # The result can contain an error message
def sendMail(self, to, subject, body, attachments=None):
@ -682,7 +682,7 @@ class ToolWrapper(AbstractWrapper):
# reindex all Appy-managed objects, ie those in folders "config"
# and "data".
# First, clear the catalog.
self.log('Recomputing the whole catalog...')
self.log('recomputing the whole catalog...')
app = self.o.getParentNode()
app.catalog._catalog.clear()
nb = 1
@ -706,7 +706,7 @@ class ToolWrapper(AbstractWrapper):
failMsg = ' (%d retried)' % len(failed)
else:
failMsg = ''
self.log('%d object(s) were reindexed%s.' % (nb, failMsg))
self.log('%d object(s) reindexed%s.' % (nb, failMsg))
else:
nb = 1
failed = []

View file

@ -79,6 +79,6 @@ class TranslationWrapper(AbstractWrapper):
def onDelete(self):
# Call a custom "onDelete" if any.
self.log('Translation "%s" deleted by "%s".' % (self.id, self.user.id))
self.log('translation "%s" deleted.' % self.id)
return self._callCustom('onDelete')
# ------------------------------------------------------------------------------

View file

@ -89,8 +89,7 @@ class UserWrapper(AbstractWrapper):
# user. So update the authentication cookie, too.
gutils.writeCookie(login, newPassword, self.request)
if log:
self.log('Password %s by "%s" for "%s".' % \
(msgPart, self.user.login, login))
self.log('password %s for %s.' % (msgPart, login))
return newPassword
def setEncryptedPassword(self, encryptedPassword):
@ -128,9 +127,8 @@ class UserWrapper(AbstractWrapper):
self.compute(className, context=context, noSecurity=True,
expression="ctx['nb'] += obj.o.applyUserIdChange(" \
"ctx['old'], ctx['new'])")
self.log("Login '%s' renamed to '%s' by '%s'." % \
(oldLogin, newLogin, self.user.login))
self.log('Login change: local roles updated in %d object(s).' % \
self.log("login %s renamed to %s." % (oldLogin, newLogin))
self.log('login change: local roles updated in %d object(s).' % \
context['nb'])
def getGrantableRoles(self):
@ -244,7 +242,7 @@ class UserWrapper(AbstractWrapper):
'''Before deleting myself, I must delete the corresponding Zope user
(for local users only).'''
if self.source == 'zodb': del self.o.acl_users.data[self.login]
self.log('User "%s" deleted.' % self.login)
self.log('user %s deleted.' % self.login)
# Call a custom "onDelete" if any.
return self._callCustom('onDelete')