Projet

Général

Profil

0006-backends-ldap-improve-style-of-error-logging-23698.patch

Benjamin Dauvergne, 04 juillet 2018 16:41

Télécharger (1,67 ko)

Voir les différences:

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(-)
src/authentic2/backends/ldap_backend.py
1181 1181
                                                    ldap.SCOPE_SUBTREE, ldap_filter)
1182 1182
                            if not results:
1183 1183
                                log.error(
1184
                                    'unable to find user %r based on external id %s',
1185
                                    unicode(user), external_id)
1184
                                    u'unable to find user %r based on external id %s',
1185
                                    user, external_id)
1186 1186
                                continue
1187 1187
                            dn = results[0][0]
1188 1188
                    except ldap.LDAPError:
1189 1189
                        log.error(
1190
                            'unable to find user %r based on external id %s', unicode(user),
1190
                            u'unable to find user %r based on external id %s',
1191
                            user,
1191 1192
                            external_id)
1192 1193
                        continue
1193 1194
                    return self._return_user(dn, None, conn, block)
1194
-