From ab913cb5acf96bbbc84614b6468d3b0cb0df09d8 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 12 Oct 2012 13:22:53 -0400 Subject: [PATCH] Fix edit_unit header to point to the correct course module --- cms/djangoapps/contentstore/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 9bdd2bdbaa..24eebe58c5 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -234,6 +234,12 @@ def edit_unit(request, location): item = modulestore().get_item(location) + # TODO: we need a smarter way to figure out what course an item is in + for course in modulestore().get_courses(): + if (course.location.org == item.location.org and + course.location.course == item.location.course): + break + # The non-draft location lms_link = get_lms_link_for_item(item.location._replace(revision=None)) @@ -270,7 +276,7 @@ def edit_unit(request, location): published_date = None return render_to_response('unit.html', { - 'context_course': item, + 'context_course': course, 'active_tab': 'courseware', 'unit': item, 'unit_location': location,