From 7d91cbb387a891b66ac8212f3282cc4c9b99d72e Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 4 Jul 2018 11:38:06 +0200 Subject: [PATCH 6/7] backends/ldap: improve style of error logging (#23698) Log string should be unicode removing the need to unicode cast the user. --- src/authentic2/backends/ldap_backend.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/authentic2/backends/ldap_backend.py b/src/authentic2/backends/ldap_backend.py index 2303c23b..30e640a7 100644 --- a/src/authentic2/backends/ldap_backend.py +++ b/src/authentic2/backends/ldap_backend.py @@ -1181,13 +1181,14 @@ class LDAPBackendPasswordLost(LDAPBackend): ldap.SCOPE_SUBTREE, ldap_filter) if not results: log.error( - 'unable to find user %r based on external id %s', - unicode(user), external_id) + u'unable to find user %r based on external id %s', + user, external_id) continue dn = results[0][0] except ldap.LDAPError: log.error( - 'unable to find user %r based on external id %s', unicode(user), + u'unable to find user %r based on external id %s', + user, external_id) continue return self._return_user(dn, None, conn, block) -- 2.18.0