Changeset 8711


Ignore:
Timestamp:
13/12/12 09:07:00 (6 years ago)
Author:
mnagni
Message:

Small refactoring

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

Legend:

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

    r8710 r8711  
    3535from django.db.utils import DatabaseError 
    3636from dj_security.exception import DSJOpenIDNotFoundError 
    37 from dj_security.encoder import SecurityEncoder 
    38 from django.shortcuts import render_to_response, redirect 
     37from django.shortcuts import render_to_response 
    3938 
    4039from userdb_model.models import User 
     
    7473            return response 
    7574 
    76         if request.path == '/account/signin/complete/' and not request.session.get('done', False): 
     75        if request.path == '/account/signin/complete/' \ 
     76                and not request.session.get('done', False): 
    7777            return _encode_authenticated_response(request, response) 
    7878 
    79         #if request.path == '/account/signin/complete/' and request.session.get('done', False): 
     79        #if request.path == '/account/signin/complete/' \ 
     80        # and request.session.get('done', False): 
    8081        #    return response 
    8182         
     
    115116 
    116117def _encode_authenticated_response(request, response, context = {}): 
    117     remote_ip = _calculate_remote_ip(base64.b64decode(request.session.get('r'))) 
     118    remote_ip = calculate_remote_ip(base64.b64decode(request.session.get('r'))) 
    118119    LOGGER.info("responding to remote_ip: %s" % (remote_ip))  
    119120    username = request.session.get('openid').openid 
     
    129130                        token.cookie_value(),  
    130131                        domain = getattr(settings, 'COOKIE_DOMAIN', None)) 
    131     LOGGER.debug("Set authTicket in response for %s from %s" % (username, remote_ip)) 
     132    LOGGER.debug("Set authTicket in response for %s from %s"  
     133                 % (username, remote_ip)) 
    132134    redirect_parameter = getattr(settings, 'REDIRECT_URL', 'r') 
    133     context['redirect_url'] = base64.b64decode(request.session.get(redirect_parameter, '')) 
     135    context['redirect_url'] = \ 
     136        base64.b64decode(request.session.get(redirect_parameter, '')) 
    134137    return render_to_response('logged_in.html', context) 
  • mauRepo/dj_security/trunk/dj_security/urls.py

    r8707 r8711  
    2424#) 
    2525 
    26 urlpatterns += patterns('dj_security.views.my_profile', 
    27     (r'^account/register/$', 'frontpage'), 
    28 ) 
     26#urlpatterns += patterns('dj_security.views.my_profile', 
     27#    (r'^account/register/$', 'frontpage'), 
     28#) 
    2929#urlpatterns += patterns('dj_security.views.my_profile', 
    3030#    (r'^account/signin/$', 'frontpage'), 
    3131#) 
    32 print urlpatterns 
Note: See TracChangeset for help on using the changeset viewer.