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
fd6e30ab
Commit
fd6e30ab
authored
Sep 11, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't try to retrieve roles for anonymous posts.
parent
45ba5831
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lms/djangoapps/django_comment_client/utils.py
+5
-3
No files found.
lms/djangoapps/django_comment_client/utils.py
View file @
fd6e30ab
...
...
@@ -241,8 +241,10 @@ def permalink(content):
args
=
[
content
[
'course_id'
],
content
[
'commentable_id'
],
content
[
'thread_id'
]])
+
'#'
+
content
[
'id'
]
def
extend_content
(
content
):
user
=
User
.
objects
.
get
(
pk
=
content
[
'user_id'
])
roles
=
dict
((
'name'
,
role
.
name
.
lower
())
for
role
in
user
.
roles
.
filter
(
course_id
=
content
[
'course_id'
]))
roles
=
{}
if
content
.
get
(
'user_id'
):
user
=
User
.
objects
.
get
(
pk
=
content
[
'user_id'
])
roles
=
dict
((
'name'
,
role
.
name
.
lower
())
for
role
in
user
.
roles
.
filter
(
course_id
=
content
[
'course_id'
]))
content_info
=
{
'displayed_title'
:
content
.
get
(
'highlighted_title'
)
or
content
.
get
(
'title'
,
''
),
'displayed_body'
:
content
.
get
(
'highlighted_body'
)
or
content
.
get
(
'body'
,
''
),
...
...
@@ -255,7 +257,7 @@ def extend_content(content):
def
get_courseware_context
(
content
,
course
):
id_map
=
get_discussion_id_map
(
course
)
id
=
content
[
'commentable_id'
]
id
=
content
[
'commentable_id'
]
content_info
=
None
if
id
in
id_map
:
location
=
id_map
[
id
][
"location"
]
.
url
()
...
...
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