Skip to content

Commit

Permalink
fix: always display course title for vc course cards
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrylo-kh committed Jan 14, 2025
1 parent 48069df commit 053a1db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion credentials/apps/verifiable_credentials/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import qrcode
from django.contrib.contenttypes.models import ContentType

from credentials.apps.catalog.models import CourseRun
from credentials.apps.credentials.api import get_user_credentials_by_content_type
from credentials.apps.credentials.data import UserCredentialStatus

Expand Down Expand Up @@ -39,8 +40,10 @@ def get_user_credentials_data(username, model):
credential.credential.program.authoring_organizations.values_list("name", flat=True)
)
elif model == "coursecertificate":
course_run = CourseRun.objects.filter(key=credential.credential.course_id).first()
course = getattr(course_run, "course", None)
credential_uuid = credential.credential.course_id
credential_title = credential.credential.title
credential_title = credential.credential.title or getattr(course, "title", "")
credential_org = credential.credential.course_key.org

data.append(
Expand Down

0 comments on commit 053a1db

Please sign in to comment.