From 326785043ed6eb942fad32e13d89d0928ad4737f Mon Sep 17 00:00:00 2001 From: Awais Date: Mon, 13 Feb 2017 17:37:11 +0500 Subject: [PATCH] Fixing course-run comment issue. ECOM-7146 --- course_discovery/apps/publisher/tests/test_views.py | 2 +- course_discovery/apps/publisher/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/course_discovery/apps/publisher/tests/test_views.py b/course_discovery/apps/publisher/tests/test_views.py index 3dbb975831..fdc7939708 100644 --- a/course_discovery/apps/publisher/tests/test_views.py +++ b/course_discovery/apps/publisher/tests/test_views.py @@ -842,7 +842,7 @@ def test_detail_page_with_comments(self): self.client.login(username=self.user.username, password=USER_PASSWORD) site = Site.objects.get(pk=settings.SITE_ID) - comment = CommentFactory(content_object=self.course, user=self.user, site=site) + comment = CommentFactory(content_object=self.course_run, user=self.user, site=site) response = self.client.get(self.page_url) self.assertEqual(response.status_code, 200) self._assert_credits_seats(response, self.wrapped_course_run.credit_seat) diff --git a/course_discovery/apps/publisher/views.py b/course_discovery/apps/publisher/views.py index cf824731d6..d381c9ca71 100644 --- a/course_discovery/apps/publisher/views.py +++ b/course_discovery/apps/publisher/views.py @@ -141,7 +141,7 @@ def get_context_data(self, **kwargs): user = self.request.user course_run = CourseRunWrapper(self.get_object()) context['object'] = course_run - context['comment_object'] = course_run.course + context['comment_object'] = course_run context['post_back_url'] = reverse('publisher:publisher_course_run_detail', kwargs={'pk': course_run.id}) context['can_edit'] = mixins.check_course_organization_permission(