def registered_for_course(course, user):
 if (user is None):
  return False
 if user.is_authenticated():
  return CourseEnrollment.is_enrolled(user, course.id)
 else:
  return False

def registered_for_course ( course , user ) : if ( user is None ) : return False if user . is_authenticated ( ) : return CourseEnrollment . is_enrolled ( user , course . id ) else : return False
return true if user is registered for course .