pep8/pylint violations fixes

This commit is contained in:
Chris Dodge
2013-09-04 11:34:35 -04:00
parent 00710f75d2
commit 0847bc5e2b
2 changed files with 5 additions and 6 deletions

View File

@@ -392,7 +392,7 @@ def cas_login(request, next_page=None, required=False):
Uses django_cas for authentication.
CAS is a common authentcation method pioneered by Yale.
See http://en.wikipedia.org/wiki/Central_Authentication_Service
Does normal CAS login then generates user_profile if nonexistent,
and if login was successful. We assume that user details are
maintained by the central service, and thus an empty user profile
@@ -400,12 +400,12 @@ def cas_login(request, next_page=None, required=False):
"""
ret = django_cas_login(request, next_page, required)
if request.user.is_authenticated():
user = request.user
if not UserProfile.objects.filter(user=user):
up = UserProfile(name=user.username, user=user)
up.save()
user_profile = UserProfile(name=user.username, user=user)
user_profile.save()
return ret

View File

@@ -862,7 +862,6 @@ if MITX_FEATURES.get('AUTH_USE_CAS'):
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'django_cas.backends.CASBackend',
)
)
INSTALLED_APPS += ('django_cas',)
MIDDLEWARE_CLASSES += ('django_cas.middleware.CASMiddleware',)