changeset 5142:12e6de3d7e29

auth: simplify logging of regular authentication in LoginRequired
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Wed, 25 Mar 2015 10:11:54 +0100
parents 9e36b8bf73b7
children 43ad9c3b7d5d
files kallithea/lib/auth.py
diffstat 1 files changed, 3 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/auth.py	Fri May 15 23:40:44 2015 +0200
+++ b/kallithea/lib/auth.py	Wed Mar 25 10:11:54 2015 +0100
@@ -777,18 +777,12 @@
                 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):