Skip to content
Snippets Groups Projects
Commit 7697b7dd authored by Michael Terry's avatar Michael Terry
Browse files

When masquerading in courseware API, reset the request user

It's important that request.user be set as the effective user,
because waffle flags and bits of code around the place look at it.

This should make masquerading more accurate to what the learner
sees.
parent 2cf023bf
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,7 @@ class CoursewareMeta:
course_key,
staff_access=self.original_user_is_staff,
)
self.request.user = self.effective_user
self.is_staff = has_access(self.effective_user, 'staff', self.overview).has_access
self.enrollment_object = CourseEnrollment.get_enrollment(self.effective_user, self.course_key,
select_related=['celebration'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment