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
655b02a5
Commit
655b02a5
authored
Sep 17, 2015
by
Christopher Lee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9739 from edx/clee/dapi-vote-bug-2
fixed vote bug in discussion api
parents
305f88f6
ccc921bc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
lms/djangoapps/discussion_api/api.py
+3
-0
lms/djangoapps/discussion_api/tests/test_api.py
+0
-0
No files found.
lms/djangoapps/discussion_api/api.py
View file @
655b02a5
...
...
@@ -515,8 +515,10 @@ def _do_extra_actions(api_content, cc_content, request_fields, actions_form, con
signal
.
send
(
sender
=
None
,
user
=
context
[
"request"
]
.
user
,
post
=
cc_content
)
if
form_value
:
context
[
"cc_requester"
]
.
vote
(
cc_content
,
"up"
)
api_content
[
"vote_count"
]
+=
1
else
:
context
[
"cc_requester"
]
.
unvote
(
cc_content
)
api_content
[
"vote_count"
]
-=
1
def
create_thread
(
request
,
thread_data
):
...
...
@@ -647,6 +649,7 @@ def update_thread(request, thread_id, update_data):
# Only save thread object if some of the edited fields are in the thread data, not extra actions
if
set
(
update_data
)
-
set
(
actions_form
.
fields
):
serializer
.
save
()
# signal to update Teams when a user edits a thread
thread_edited
.
send
(
sender
=
None
,
user
=
request
.
user
,
post
=
cc_thread
)
api_thread
=
serializer
.
data
_do_extra_actions
(
api_thread
,
cc_thread
,
update_data
.
keys
(),
actions_form
,
context
)
...
...
lms/djangoapps/discussion_api/tests/test_api.py
View file @
655b02a5
This diff is collapsed.
Click to expand it.
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