Commit efbb5ed6 by Renzo Lucioni

Tighten up program details view

Condense view logic left over from removal of Waffle switch.

ECOM-6602
parent 131cc0bd
......@@ -57,6 +57,10 @@ def program_details(request, program_uuid):
raise Http404
program_data = ProgramDataExtender(program_data, request.user).extend()
course_data = meter.progress(programs=[program_data], count_only=False)[0]
certificate_data = get_certificates(request.user, program_data)
program_data.pop('courses')
urls = {
'program_listing_url': reverse('program_listing_view'),
......@@ -66,25 +70,16 @@ def program_details(request, program_uuid):
'commerce_api_url': reverse('commerce_api:v0:baskets:create'),
}
# TODO: Tighten this up!
context = {
'urls': urls,
'show_program_listing': programs_config.enabled,
'nav_hidden': True,
'disable_courseware_js': True,
'uses_pattern_library': True,
'user_preferences': get_user_preferences(request.user)
}
course_data = meter.progress(programs=[program_data], count_only=False)[0]
certificate_data = get_certificates(request.user, program_data)
program_data.pop('courses')
context.update({
'user_preferences': get_user_preferences(request.user),
'program_data': program_data,
'course_data': course_data,
'certificate_data': certificate_data,
})
}
return render_to_response('learner_dashboard/program_details.html', context)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment