Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
439f72f9
Commit
439f72f9
authored
Jun 15, 2015
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8524 from edx/gprice/discussion-api-parent-id-fix
Fix bug in discussion API comment update
parents
2175b5ba
3c48585c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
lms/djangoapps/discussion_api/api.py
+1
-5
lms/djangoapps/discussion_api/tests/test_api.py
+4
-3
No files found.
lms/djangoapps/discussion_api/api.py
View file @
439f72f9
...
@@ -85,11 +85,7 @@ def _get_comment_and_context(request, comment_id):
...
@@ -85,11 +85,7 @@ def _get_comment_and_context(request, comment_id):
"""
"""
try
:
try
:
cc_comment
=
Comment
(
id
=
comment_id
)
.
retrieve
()
cc_comment
=
Comment
(
id
=
comment_id
)
.
retrieve
()
_
,
context
=
_get_thread_and_context
(
_
,
context
=
_get_thread_and_context
(
request
,
cc_comment
[
"thread_id"
])
request
,
cc_comment
[
"thread_id"
],
cc_comment
[
"parent_id"
]
)
return
cc_comment
,
context
return
cc_comment
,
context
except
CommentClientRequestError
:
except
CommentClientRequestError
:
raise
Http404
raise
Http404
...
...
lms/djangoapps/discussion_api/tests/test_api.py
View file @
439f72f9
...
@@ -1689,13 +1689,14 @@ class UpdateCommentTest(CommentsServiceMockMixin, UrlResetMixin, ModuleStoreTest
...
@@ -1689,13 +1689,14 @@ class UpdateCommentTest(CommentsServiceMockMixin, UrlResetMixin, ModuleStoreTest
for
request
in
httpretty
.
httpretty
.
latest_requests
:
for
request
in
httpretty
.
httpretty
.
latest_requests
:
self
.
assertEqual
(
request
.
method
,
"GET"
)
self
.
assertEqual
(
request
.
method
,
"GET"
)
def
test_basic
(
self
):
@ddt.data
(
None
,
"test_parent"
)
self
.
register_comment
()
def
test_basic
(
self
,
parent_id
):
self
.
register_comment
({
"parent_id"
:
parent_id
})
actual
=
update_comment
(
self
.
request
,
"test_comment"
,
{
"raw_body"
:
"Edited body"
})
actual
=
update_comment
(
self
.
request
,
"test_comment"
,
{
"raw_body"
:
"Edited body"
})
expected
=
{
expected
=
{
"id"
:
"test_comment"
,
"id"
:
"test_comment"
,
"thread_id"
:
"test_thread"
,
"thread_id"
:
"test_thread"
,
"parent_id"
:
None
,
# TODO: we can't get this without retrieving from the thread :-(
"parent_id"
:
parent_id
,
"author"
:
self
.
user
.
username
,
"author"
:
self
.
user
.
username
,
"author_label"
:
None
,
"author_label"
:
None
,
"created_at"
:
"2015-06-03T00:00:00Z"
,
"created_at"
:
"2015-06-03T00:00:00Z"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment