Hi everyone,
I’m trying to generate a certificate for a student in a course on our Tutor/Open edX instance, but I keep running into issues. I’ve tried marking the user as passed manually and running cert_generation, but the LMS still shows the course as incomplete, and the certificate is not being generated.
Environment:
-
Open edX / Tutor instance (2025)
-
Python 3.11
-
Using Docker containers for LMS/Studio
Steps I’ve taken:
- Attempted generating certificate via command line:
./manage.py lms --settings=tutor.production cert_generation --user 49 --course "course-v1:SSVN+SCC002+2025"
Output:
49 does not have a passing grade in course-v1:SSVN+SCC002+2025. Certificate cannot be generated.
- Tried marking user as passed in Python shell:
from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from lms.djangoapps.grades.models import PersistentCourseGrade
from lms.djangoapps.courseware.models import StudentModule
user = User.objects.get(id=49)
course_key = CourseKey.from_string("course-v1:SSVN+SCC002+2025")
# Set grade
grade, _ = PersistentCourseGrade.objects.get_or_create(user_id=user.id, course_id=course_key)
grade.percent_grade = 1.0
grade.letter_grade = "Pass"
grade.passed = True
grade.save()
# Mark all course blocks completed
StudentModule.objects.filter(student_id=user.id, course_id=course_key).update(grade=1.0, done=True)
- Attempted to recalc course grade using
CourseGradeFactory():
from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
course = CourseOverview.get_from_id(course_key)
CourseGradeFactory().update(user, course)
Output:
AttributeError: 'CourseOverview' object has no attribute 'grade_cutoffs'
Tried using generate_certificate_for_user and other suggested methods from documentation/examples, but either imports fail or the commands don’t exist on Tutor.
Problems I’m facing:
-
The LMS still shows the course as incomplete for the user.
-
Certificate cannot be generated via
cert_generationbecause either:-
The user is not “passing”
-
The enrollment mode (audit/honor) mismatch
-
-
Cannot locate the generated PDF anywhere in the container.
-
Celery worker commands either don’t exist or cannot be run due to the Tutor setup.
-
Python shell approaches fail due to import errors or attribute errors.
What I want:
-
To generate a certificate for a user manually for testing purposes.
-
To locate the certificate PDF to download/view.
Has anyone successfully bypassed the “passing grade” / “enrollment mode” checks for testing certificates in a Tutor/Open edX 2025 instance?
Any guidance on the correct sequence of steps in Tutor to get a test certificate would be extremely helpful.