[PATCH 4 of 5] auth: simplify logging of regular authentication in LoginRequired

Thomas De Schampheleire patrickdepinguin at gmail.com
Wed Mar 25 07:01:32 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 e1a755428e3abd3d011c7c033233272dadb34572
# Parent  32ced9e32b506c7441339f67da3c4237de0e6fa3
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
@@ -772,18 +772,12 @@
                 log.warning('API access to %s is not allowed' % loc)
                 raise HTTPForbidden()
 
-        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