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
8d2211a6
Commit
8d2211a6
authored
Jul 08, 2014
by
Greg Price
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle question posts from comments service
parent
854621be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
lms/djangoapps/django_comment_client/utils.py
+11
-6
lms/lib/comment_client/thread.py
+2
-1
No files found.
lms/djangoapps/django_comment_client/utils.py
View file @
8d2211a6
...
...
@@ -293,7 +293,11 @@ def get_annotated_content_infos(course_id, thread, user, user_info):
def
annotate
(
content
):
infos
[
str
(
content
[
'id'
])]
=
get_annotated_content_info
(
course_id
,
content
,
user
,
user_info
)
for
child
in
content
.
get
(
'children'
,
[]):
for
child
in
(
content
.
get
(
'children'
,
[])
+
content
.
get
(
'endorsed_responses'
,
[])
+
content
.
get
(
'non_endorsed_responses'
,
[])
):
annotate
(
child
)
annotate
(
thread
)
return
infos
...
...
@@ -369,15 +373,16 @@ def safe_content(content, is_staff=False):
'at_position_list'
,
'children'
,
'highlighted_title'
,
'highlighted_body'
,
'courseware_title'
,
'courseware_url'
,
'unread_comments_count'
,
'read'
,
'group_id'
,
'group_name'
,
'group_string'
,
'pinned'
,
'abuse_flaggers'
,
'stats'
,
'resp_skip'
,
'resp_limit'
,
'resp_total'
,
'stats'
,
'resp_skip'
,
'resp_limit'
,
'resp_total'
,
'thread_type'
,
'endorsed_responses'
,
'non_endorsed_responses'
,
'non_endorsed_resp_total'
,
]
if
(
content
.
get
(
'anonymous'
)
is
False
)
and
((
content
.
get
(
'anonymous_to_peers'
)
is
False
)
or
is_staff
):
fields
+=
[
'username'
,
'user_id'
]
if
'children'
in
content
:
safe_children
=
[
safe_content
(
child
)
for
child
in
content
[
'children'
]]
content
[
'children'
]
=
safe_children
for
child_content_key
in
[
"children"
,
"endorsed_responses"
,
"non_endorsed_responses"
]:
if
child_content_key
in
content
:
safe_children
=
[
safe_content
(
child
)
for
child
in
content
[
child_content_key
]]
content
[
child_content_key
]
=
safe_children
return
strip_none
(
extract
(
content
,
fields
))
lms/lib/comment_client/thread.py
View file @
8d2211a6
...
...
@@ -16,7 +16,8 @@ class Thread(models.Model):
'created_at'
,
'updated_at'
,
'comments_count'
,
'unread_comments_count'
,
'at_position_list'
,
'children'
,
'type'
,
'highlighted_title'
,
'highlighted_body'
,
'endorsed'
,
'read'
,
'group_id'
,
'group_name'
,
'pinned'
,
'abuse_flaggers'
,
'resp_skip'
,
'resp_limit'
,
'resp_total'
'abuse_flaggers'
,
'resp_skip'
,
'resp_limit'
,
'resp_total'
,
'thread_type'
,
'endorsed_responses'
,
'non_endorsed_responses'
,
'non_endorsed_resp_total'
,
]
updatable_fields
=
[
...
...
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