Changeset 8688


Ignore:
Timestamp:
21/11/12 10:46:37 (7 years ago)
Author:
mnagni
Message:

Corrects syntax erros

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

Legend:

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

    r8687 r8688  
    5656        remote_ip = _calculate_remote_ip(request) 
    5757        LOGGER.debug("responding to remote_ip: %s" % (remote_ip))       
    58         username = request.POST['username'] 
     58        username = request.POST.get('username') 
    5959        token = AuthTicket( 
    6060                    getattr(settings, 'SHARED_SECRET', 'sharedsecret'),  
  • mauRepo/dj_security/trunk/dj_security/views/dj_security_login.py

    r8687 r8688  
    2727        context['form'] = form 
    2828        if form.is_valid(): # All validation rules pass 
    29             username = getattr(request.POST, 'username', '') 
    30             password = getattr(request.POST, 'password', '') 
     29            username = request.POST.get('username') 
     30            password = request.POST.get('password') 
    3131            LOGGER.debug("logging: %s" % (username))             
    3232            user = authenticate(username=username, password=password)              
     
    3636                    LOGGER.debug("user %s is Active" % (username))            
    3737                    context['user'] = SecurityEncoder().encode(user) 
    38                     request.auth_user = context['user'] 
     38                    request.auth_user = context.get('user') 
    3939                    return _encode_authenticated_response(request, context)          
    4040                else: 
Note: See TracChangeset for help on using the changeset viewer.