Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [AXM-1299] always display course title for vc course cards #192

Merged
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
5 changes: 4 additions & 1 deletion credentials/apps/verifiable_credentials/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

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


def get_user_credentials_data(username, model):
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
Loading