diff --git a/lms/djangoapps/discussion_api/api.py b/lms/djangoapps/discussion_api/api.py index fb6b793970..8ce8405f5e 100644 --- a/lms/djangoapps/discussion_api/api.py +++ b/lms/djangoapps/discussion_api/api.py @@ -111,7 +111,6 @@ def _cc_thread_to_api_thread(thread, cc_user, staff_user_ids, ta_user_ids, group "group_id", "created_at", "updated_at", - "type", "title", "pinned", "closed", @@ -127,6 +126,7 @@ def _cc_thread_to_api_thread(thread, cc_user, staff_user_ids, ta_user_ids, group "community_ta" if int(thread["user_id"]) in ta_user_ids else None ), + "type": thread["thread_type"], "raw_body": thread["body"], "following": thread["id"] in cc_user["subscribed_thread_ids"], "abuse_flagged": cc_user["id"] in thread["abuse_flaggers"], diff --git a/lms/djangoapps/discussion_api/tests/test_api.py b/lms/djangoapps/discussion_api/tests/test_api.py index 3cf504fb04..c92766c6e2 100644 --- a/lms/djangoapps/discussion_api/tests/test_api.py +++ b/lms/djangoapps/discussion_api/tests/test_api.py @@ -369,7 +369,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase): "anonymous_to_peers": False, "created_at": "1970-01-01T00:00:00Z", "updated_at": "1970-01-01T00:00:00Z", - "type": "discussion", + "thread_type": "discussion", "title": "dummy", "body": "dummy", "pinned": False, @@ -421,7 +421,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase): "anonymous_to_peers": False, "created_at": "2015-04-28T00:00:00Z", "updated_at": "2015-04-28T11:11:11Z", - "type": "discussion", + "thread_type": "discussion", "title": "Test Title", "body": "Test body", "pinned": False, @@ -442,7 +442,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase): "anonymous_to_peers": False, "created_at": "2015-04-28T22:22:22Z", "updated_at": "2015-04-28T00:33:33Z", - "type": "question", + "thread_type": "question", "title": "Another Test Title", "body": "More content", "pinned": False, @@ -463,7 +463,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase): "anonymous_to_peers": False, "created_at": "2015-04-28T00:44:44Z", "updated_at": "2015-04-28T00:55:55Z", - "type": "discussion", + "thread_type": "discussion", "title": "Yet Another Test Title", "body": "Still more content", "pinned": True, diff --git a/lms/djangoapps/discussion_api/tests/test_views.py b/lms/djangoapps/discussion_api/tests/test_views.py index 1ed979b80b..d6eee0d221 100644 --- a/lms/djangoapps/discussion_api/tests/test_views.py +++ b/lms/djangoapps/discussion_api/tests/test_views.py @@ -154,7 +154,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase): "anonymous_to_peers": False, "created_at": "2015-04-28T00:00:00Z", "updated_at": "2015-04-28T11:11:11Z", - "type": "discussion", + "thread_type": "discussion", "title": "Test Title", "body": "Test body", "pinned": False,