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 ...@@ -111,7 +111,6 @@ def _cc_thread_to_api_thread(thread, cc_user, staff_user_ids, ta_user_ids, group
"group_id", "group_id",
"created_at", "created_at",
"updated_at", "updated_at",
"type",
"title", "title",
"pinned", "pinned",
"closed", "closed",
...@@ -127,6 +126,7 @@ def _cc_thread_to_api_thread(thread, cc_user, staff_user_ids, ta_user_ids, group ...@@ -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 "community_ta" if int(thread["user_id"]) in ta_user_ids else
None None
), ),
"type": thread["thread_type"],
"raw_body": thread["body"], "raw_body": thread["body"],
"following": thread["id"] in cc_user["subscribed_thread_ids"], "following": thread["id"] in cc_user["subscribed_thread_ids"],
"abuse_flagged": cc_user["id"] in thread["abuse_flaggers"], "abuse_flagged": cc_user["id"] in thread["abuse_flaggers"],
......
...@@ -369,7 +369,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase): ...@@ -369,7 +369,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase):
"anonymous_to_peers": False, "anonymous_to_peers": False,
"created_at": "1970-01-01T00:00:00Z", "created_at": "1970-01-01T00:00:00Z",
"updated_at": "1970-01-01T00:00:00Z", "updated_at": "1970-01-01T00:00:00Z",
"type": "discussion", "thread_type": "discussion",
"title": "dummy", "title": "dummy",
"body": "dummy", "body": "dummy",
"pinned": False, "pinned": False,
...@@ -421,7 +421,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase): ...@@ -421,7 +421,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase):
"anonymous_to_peers": False, "anonymous_to_peers": False,
"created_at": "2015-04-28T00:00:00Z", "created_at": "2015-04-28T00:00:00Z",
"updated_at": "2015-04-28T11:11:11Z", "updated_at": "2015-04-28T11:11:11Z",
"type": "discussion", "thread_type": "discussion",
"title": "Test Title", "title": "Test Title",
"body": "Test body", "body": "Test body",
"pinned": False, "pinned": False,
...@@ -442,7 +442,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase): ...@@ -442,7 +442,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase):
"anonymous_to_peers": False, "anonymous_to_peers": False,
"created_at": "2015-04-28T22:22:22Z", "created_at": "2015-04-28T22:22:22Z",
"updated_at": "2015-04-28T00:33:33Z", "updated_at": "2015-04-28T00:33:33Z",
"type": "question", "thread_type": "question",
"title": "Another Test Title", "title": "Another Test Title",
"body": "More content", "body": "More content",
"pinned": False, "pinned": False,
...@@ -463,7 +463,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase): ...@@ -463,7 +463,7 @@ class GetThreadListTest(CommentsServiceMockMixin, ModuleStoreTestCase):
"anonymous_to_peers": False, "anonymous_to_peers": False,
"created_at": "2015-04-28T00:44:44Z", "created_at": "2015-04-28T00:44:44Z",
"updated_at": "2015-04-28T00:55:55Z", "updated_at": "2015-04-28T00:55:55Z",
"type": "discussion", "thread_type": "discussion",
"title": "Yet Another Test Title", "title": "Yet Another Test Title",
"body": "Still more content", "body": "Still more content",
"pinned": True, "pinned": True,
......
...@@ -154,7 +154,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase): ...@@ -154,7 +154,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
"anonymous_to_peers": False, "anonymous_to_peers": False,
"created_at": "2015-04-28T00:00:00Z", "created_at": "2015-04-28T00:00:00Z",
"updated_at": "2015-04-28T11:11:11Z", "updated_at": "2015-04-28T11:11:11Z",
"type": "discussion", "thread_type": "discussion",
"title": "Test Title", "title": "Test Title",
"body": "Test body", "body": "Test body",
"pinned": False, "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