Skip to content

Commit

Permalink
chore: Cherry-pick LTI deep linking v8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mfarhan943 committed Mar 20, 2024
1 parent 3088b61 commit 78faf75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lti_consumer/lti_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit 78faf75

Please sign in to comment.