Commit 608ca88f by Greg Price

Merge pull request #8007 from edx/gprice/discussion-api-thread-list-fix-type

Fix type field in thread list endpoint
parents a998a3f3 6189cf9b
......@@ -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"],
......
......@@ -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,
......
......@@ -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,
......
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