From e4effc64ec99bcf88257cf2374c5df9b6bb22f3b Mon Sep 17 00:00:00 2001 From: kakwa Date: Sun, 12 Mar 2017 17:45:01 +0100 Subject: [PATCH] fixing log errors in auth "none" mode replacing None by unknown as a default value in order to avoid error in generating log msg because None is not a string --- ldapcherry/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index 21f5c30..60ce654 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -677,7 +677,7 @@ class LdapCherry(object): key = self.attributes.get_key() username = params['attrs'][key] sess = cherrypy.session - admin = sess.get(SESSION_KEY, None) + admin = sess.get(SESSION_KEY, 'unknown') cherrypy.log.error( msg="user '" + username + "' added by '" + admin + "'", @@ -774,7 +774,7 @@ class LdapCherry(object): ) sess = cherrypy.session - admin = sess.get(SESSION_KEY, None) + admin = sess.get(SESSION_KEY, 'unknown') cherrypy.log.error( msg="user '" + username + "' modified by '" + admin + "'", @@ -860,7 +860,7 @@ class LdapCherry(object): def _deleteuser(self, username): sess = cherrypy.session - admin = sess.get(SESSION_KEY, None) + admin = sess.get(SESSION_KEY, 'unknown') for b in self.backends: try: