backends/ldap: improve style of error logging (#23698)

Log string should be unicode removing the need to unicode cast the user.
This commit is contained in:
Benjamin Dauvergne 2018-07-04 11:38:06 +02:00
parent a22a797172
commit f2c5b172be
1 changed files with 4 additions and 3 deletions

View File

@ -1184,13 +1184,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)