Changeset 8725 for mauRepo


Ignore:
Timestamp:
04/02/13 10:38:53 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22614: [CEDA Site Python Port] Dataset application - fix layout
 http://team.ceda.ac.uk/trac/ceda/ticket/22614

minimal update to logging

Location:
mauRepo/dj_security_middleware/trunk/dj_security_middleware/dj_security_middleware
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/dj_security_middleware/trunk/dj_security_middleware/dj_security_middleware/middleware.py

    r8703 r8725  
    4545 
    4646# Get an instance of a logger 
    47 LOGGER = logging.getLogger(__name__) 
     47LOGGER = logging.getLogger() 
    4848 
    4949LOGIN_SERVICE_ERROR = 'No LOGIN_SETTING parameter is defined in the \ 
     
    101101                                             'user_data': user_data} 
    102102            LOGGER.debug("stored in request - userid:%s, user_data:%s" % (userid, user_data)) 
    103         except (MissingCookieException, DJMiddlewareException):         
    104             url = '%s?%s' % (settings.DJ_SECURITY_LOGIN_SERVICE, _build_ret_url(request)) 
    105             LOGGER.debug("error in authentication. Redirecting to %s" % (url))             
    106             return HttpResponseRedirect(url) 
     103            pass 
     104        except MissingCookieException as ex: 
     105            LOGGER.info("Missing 'auth_tkt' cookie") 
     106        except DJMiddlewareException as ex:         
     107            LOGGER.info(ex) 
     108        url = '%s?%s' % (settings.DJ_SECURITY_LOGIN_SERVICE, _build_ret_url(request)) 
     109        LOGGER.info("error in authentication. Redirecting to %s" % (url)) 
     110        return HttpResponseRedirect(url)            
    107111             
    108112 
  • mauRepo/dj_security_middleware/trunk/dj_security_middleware/dj_security_middleware/test/security_filter.py

    r8696 r8725  
    8585        self.assertFalse(security_url_filter('http://cidev1.jc.rl.ac.uk/my_ceda/3_test',  
    8686                         ['test', '/my_ceda/[1-2]']), 
    87          "Error, Cannot filter global regexpr")         
     87         "Error, Cannot filter global regexpr")  
     88        self.assertTrue(security_url_filter('http://cidev1.jc.rl.ac.uk/my_ceda/myceda/',  
     89                         ['test', '/my_ceda/myceda']), 
     90         "Error, Cannot filter global regexpr")        
    8891 
    8992 
Note: See TracChangeset for help on using the changeset viewer.