From abdc46793f2bba474a5785551d783f9dbfc8535b Mon Sep 17 00:00:00 2001 From: SaadYousaf Date: Thu, 28 Oct 2021 00:41:25 +0500 Subject: [PATCH] fix: add cache to forum role lookup --- common/djangoapps/student/role_helpers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/djangoapps/student/role_helpers.py b/common/djangoapps/student/role_helpers.py index ffe0f2c9f2..132595f5a2 100644 --- a/common/djangoapps/student/role_helpers.py +++ b/common/djangoapps/student/role_helpers.py @@ -10,6 +10,7 @@ from openedx.core.djangoapps.django_comment_common.models import ( FORUM_ROLE_MODERATOR, Role ) +from openedx.core.lib.cache_utils import request_cached from common.djangoapps.student.roles import ( CourseBetaTesterRole, CourseInstructorRole, @@ -20,6 +21,7 @@ from common.djangoapps.student.roles import ( ) +@request_cached() def has_staff_roles(user, course_key): """ Return true if a user has any of the following roles