openedx / openedx/openedx-platform

Instructor can't request certificate on behalf of a learner when masquerading as a learner

Open
#34,112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.2k
Forks
4.4k
Avg merge
6d 18h
Merged PRs (30d)
42

Description

As an instructor, masquerading as a learner who has passed the course – I am unable to request a certificate on behalf of that leaner.

The generate_user_cert function uses request.user for the student object.

There is a note in the _progress function:

# NOTE: To make sure impersonation by instructor works, use
# student instead of request.user in the rest of the function.

I believe this is how the generate_user_cert function should also work when an instructor is using the masquerade feature.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lms/djangoapps/courseware/views/views.py at generate_user_cert and compare its use of request.user with the student handling in _progress around lines 984-985. Done means an instructor masquerading as a learner who passed the course can request that learner's certificate, without changing behavior for ordinary requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.