From 78faf75ab890dbd0102e7155d028536394227a33 Mon Sep 17 00:00:00 2001 From: Muhammad Farhan Date: Wed, 20 Mar 2024 12:15:35 +0500 Subject: [PATCH] chore: Cherry-pick LTI deep linking v8.0.0 --- lti_consumer/lti_xblock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lti_consumer/lti_xblock.py b/lti_consumer/lti_xblock.py index 3fe04ff7..1b51c0c2 100644 --- a/lti_consumer/lti_xblock.py +++ b/lti_consumer/lti_xblock.py @@ -771,7 +771,7 @@ def role(self): if not user.opt_attrs["edx-platform.is_authenticated"]: raise LtiError(self.ugettext("Could not get user data for current request")) - return user.opt_attrs.get('edx-platform.user_role', 'student') + return 'staff' if user.opt_attrs.get('edx-platform.user_is_staff') else 'student' @property def course(self): @@ -825,7 +825,7 @@ def anonymous_user_id(self): It will return the proper anonymous ID in the LMS. """ user_id = self.runtime.service(self, 'user').get_current_user().opt_attrs.get( - 'edx-platform.anonymous_user_id', None) + 'edx-platform.user_id', self.runtime.anonymous_student_id) if user_id is None: raise LtiError(self.ugettext("Could not get user id for current request"))