[PATCH 6 of 6 v2] auth: simplify logging of regular authentication in LoginRequired

Thomas De Schampheleire patrickdepinguin at gmail.com
Sun May 10 14:22:58 EDT 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1427274714 -3600
#      Wed Mar 25 10:11:54 2015 +0100
# Node ID 98c06fc800ed0f0635f3aa189177027b3f8e6c1f
# Parent  b8ff1ec9f8e70a4540ab03db822367cde8ea1df2
auth: simplify logging of regular authentication in LoginRequired

diff --git a/kallithea/lib/auth.py b/kallithea/lib/auth.py
--- a/kallithea/lib/auth.py
+++ b/kallithea/lib/auth.py
@@ -777,18 +777,12 @@ class LoginRequired(object):
                 log.error('CSRF check failed')
                 return abort(403)
 
-        log.debug('Checking if %s is authenticated @ %s' % (user.username, loc))
-        reason = 'RegularAuth' if user.is_authenticated else 'APIAuth'
-
+        # regular user authentication
         if user.is_authenticated:
-            log.info('user %s authenticating with:%s IS authenticated on func %s '
-                     % (user, reason, loc)
-            )
+            log.info('user %s authenticated with regular auth @ %s' % (user, loc))
             return func(*fargs, **fkwargs)
         else:
-            log.warning('user %s authenticating with:%s NOT authenticated on func: %s: '
-                     % (user, reason, loc)
-            )
+            log.warning('user %s NOT authenticated with regular auth @ %s' % (user, loc))
             return redirect_to_login()
 
 class NotAnonymous(object):


More information about the kallithea-general mailing list