Minor changes (mainly formatting)
authorSofia Papagiannaki <papagian@gmail.com>
Thu, 25 Oct 2012 16:10:14 +0000 (19:10 +0300)
committerSofia Papagiannaki <papagian@gmail.com>
Thu, 25 Oct 2012 16:10:14 +0000 (19:10 +0300)
snf-astakos-app/astakos/im/management/commands/_common.py
snf-astakos-app/astakos/im/target/shibboleth.py
snf-astakos-app/astakos/im/util.py

index 44812ef..63a3542 100644 (file)
@@ -39,7 +39,7 @@ from django.contrib.contenttypes.models import ContentType
 
 from astakos.im.models import AstakosUser
 
-content_type = None
+DEFAULT_CONTENT_TYPE = None
 
 
 def get_user(email_or_id, **kwargs):
@@ -67,14 +67,11 @@ def format_date(d):
 
 
 def get_astakosuser_content_type():
-    if content_type:
-        return content_type
-
     try:
         return ContentType.objects.get(app_label='im',
                                        model='astakosuser')
     except:
-        return content_type
+        return DEFAULT_CONTENT_TYPE
 
 
 def add_user_permission(user, pname):
index 0bb1466..94c18bf 100644 (file)
@@ -60,8 +60,7 @@ class Tokens:
 @requires_anonymous
 def login(request, backend=None, on_login_template='im/login.html',
           on_creation_template='im/third_party_registration.html',
-          extra_context=None
-          ):
+          extra_context=None):
     tokens = request.META
 
     try:
@@ -113,4 +112,4 @@ def login(request, backend=None, on_login_template='im/login.html',
                                signup_form=form,
                                provider='shibboleth',
                                context_instance=get_context(request,
-                                                            extra_context))
+                                                            extra_context))
\ No newline at end of file
index 44333cb..3c8f58a 100644 (file)
@@ -146,8 +146,7 @@ def set_cookie(response, user):
     cookie_value = quote(user.email + '|' + user.auth_token)
     response.set_cookie(COOKIE_NAME, value=cookie_value,
                         expires=expire_fmt, path='/',
-                        domain=COOKIE_DOMAIN, secure=COOKIE_SECURE
-                        )
+                        domain=COOKIE_DOMAIN, secure=COOKIE_SECURE)
     msg = 'Cookie [expiring %s] set for %s' % (
         user.auth_token_expires,
         user.email