Commit 82eee4af by Calen Pennington

Merge pull request #1325 from MITx/feature/cale/anon-user-bugfix

Anonymous users don't have an email attribute, and shouldn't be checked ...
parents 5d6c5de8 bbcab731
......@@ -127,7 +127,7 @@ def _has_access_course_desc(user, course, action):
return True
# if user is in CourseEnrollmentAllowed with right course_id then can also enroll
if user is not None and CourseEnrollmentAllowed:
if user is not None and user.is_authenticated() and CourseEnrollmentAllowed:
if CourseEnrollmentAllowed.objects.filter(email=user.email, course_id=course.id):
return True
......
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