changeset 4730:52bf718b30f5

auth: don't log a message when auth without username fails - that happens all the time for basic auth and ldap
author Mads Kiilerich <madski@unity3d.com>
date Tue, 06 Jan 2015 00:54:36 +0100
parents c796b6bdd532
children c154dc461bd5
files kallithea/lib/auth_modules/__init__.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/auth_modules/__init__.py	Tue Jan 06 00:54:36 2015 +0100
+++ b/kallithea/lib/auth_modules/__init__.py	Tue Jan 06 00:54:36 2015 +0100
@@ -417,6 +417,7 @@
             return plugin_user
 
         # we failed to Auth because .auth() method didn't return proper the user
-        log.warning("User `%s` failed to authenticate against %s"
-                    % (username, plugin.__module__))
+        if username:
+            log.warning("User `%s` failed to authenticate against %s"
+                        % (username, plugin.__module__))
     return None