Skip to content

Commit

Permalink
fix: debugging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperhodge committed Apr 16, 2024
1 parent 30ef290 commit 9f2e39a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion common/djangoapps/student/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def user_has_role(user, role):

if role.has_user(user):
return True
return False
# If not, then check inferred permissions
if (isinstance(role, (CourseStaffRole, CourseBetaTesterRole)) and
CourseInstructorRole(role.course_key).has_user(user)):
Expand Down
1 change: 0 additions & 1 deletion common/djangoapps/student/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import logging
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from contextlib import contextmanager

from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
Expand Down
7 changes: 5 additions & 2 deletions openedx/core/djangoapps/enrollments/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,12 @@ def get_course_enrollment_info(course_id, include_expired=False):

def get_user_roles(username, by_course_id=False):
"""
Returns a list of all roles that this user has.
Returns a list of all roles that this user has as a set.
If you specify by_course_id=True, it will instead return a dictionary of course_id to roles,
which has a better lookup time if you are looking for specific course ids.
:param username: The id of the selected user.
:return: All roles for all courses that this user has.
:return: A set of all roles for all courses that this user has
or a dictionary of course_id to roles with the key "no_course_id" for roles that are not course specific.
"""
# pylint: disable=protected-access
user = _get_user(username)
Expand Down

0 comments on commit 9f2e39a

Please sign in to comment.