Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

LP-2452 🐛 User is unable to get specialization certificate. #1913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions openedx/core/djangoapps/programs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def completed_programs_with_available_dates(self):
"""
# Query for all user certs up front, for performance reasons (rather than querying per course run).
user_certificates = GeneratedCertificate.eligible_certificates.filter(user=self.user)
certificates_by_run = {cert.course_id: cert for cert in user_certificates}
certificates_by_run = {str(cert.course_id): cert for cert in user_certificates}

completed = {}
for program in self.programs:
Expand All @@ -313,14 +313,14 @@ def _available_date_for_program(self, program_data, certificates):
key = CourseKey.from_string(course_run['key'])

# Get a certificate if one exists
certificate = certificates.get(key)
certificate = certificates.get(course_run['key'])
if certificate is None:
continue

# Modes must match (see _is_course_complete() comments for why)
course_run_mode = self._course_run_mode_translation(course_run['type'])
certificate_mode = self._certificate_mode_translation(certificate.mode)
modes_match = course_run_mode == certificate_mode
modes_match = True if course_run['type'] is None else course_run_mode == certificate_mode

# Grab the available date and keep it if it's the earliest one for this catalog course.
if modes_match and certificate_api.is_passing_status(certificate.status):
Expand Down