Don't show certificate on profile if no active config.

Stop showing certificate information on profile page if there is no
active certificate configuration.

PROD-1200
This commit is contained in:
Waheed Ahmed
2020-01-28 19:43:06 +05:00
parent d98ce06354
commit 442da4a7fe
5 changed files with 34 additions and 2 deletions

View File

@@ -44,7 +44,10 @@ class LearnerAchievementsFragmentView(EdxFragmentView):
course_overview = CourseOverview.get_from_id(course_key)
course_certificate['course'] = course_overview
if certificates_viewable_for_course(course_overview):
passing_certificates.append(course_certificate)
# add certificate into passing certificate list only if it's a PDF certificate
# or there is an active certificate configuration.
if course_certificate['is_pdf_certificate'] or course_overview.has_any_active_web_certificate:
passing_certificates.append(course_certificate)
except CourseOverview.DoesNotExist:
# This is unlikely to fail as the course should exist.
# Ideally the cert should have all the information that