Commit 0847bc5e by Chris Dodge

pep8/pylint violations fixes

parent 00710f75
...@@ -392,7 +392,7 @@ def cas_login(request, next_page=None, required=False): ...@@ -392,7 +392,7 @@ def cas_login(request, next_page=None, required=False):
Uses django_cas for authentication. Uses django_cas for authentication.
CAS is a common authentcation method pioneered by Yale. CAS is a common authentcation method pioneered by Yale.
See http://en.wikipedia.org/wiki/Central_Authentication_Service See http://en.wikipedia.org/wiki/Central_Authentication_Service
Does normal CAS login then generates user_profile if nonexistent, Does normal CAS login then generates user_profile if nonexistent,
and if login was successful. We assume that user details are and if login was successful. We assume that user details are
maintained by the central service, and thus an empty user profile maintained by the central service, and thus an empty user profile
...@@ -400,12 +400,12 @@ def cas_login(request, next_page=None, required=False): ...@@ -400,12 +400,12 @@ def cas_login(request, next_page=None, required=False):
""" """
ret = django_cas_login(request, next_page, required) ret = django_cas_login(request, next_page, required)
if request.user.is_authenticated(): if request.user.is_authenticated():
user = request.user user = request.user
if not UserProfile.objects.filter(user=user): if not UserProfile.objects.filter(user=user):
up = UserProfile(name=user.username, user=user) user_profile = UserProfile(name=user.username, user=user)
up.save() user_profile.save()
return ret return ret
......
...@@ -862,7 +862,6 @@ if MITX_FEATURES.get('AUTH_USE_CAS'): ...@@ -862,7 +862,6 @@ if MITX_FEATURES.get('AUTH_USE_CAS'):
AUTHENTICATION_BACKENDS = ( AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', 'django.contrib.auth.backends.ModelBackend',
'django_cas.backends.CASBackend', 'django_cas.backends.CASBackend',
) )
INSTALLED_APPS += ('django_cas',) INSTALLED_APPS += ('django_cas',)
MIDDLEWARE_CLASSES += ('django_cas.middleware.CASMiddleware',) MIDDLEWARE_CLASSES += ('django_cas.middleware.CASMiddleware',)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment