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
5aa104bf
Commit
5aa104bf
authored
Sep 14, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't explode if a forum content piece is by a user that doesn't exist
parent
cde2f4bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lms/djangoapps/django_comment_client/utils.py
+6
-2
No files found.
lms/djangoapps/django_comment_client/utils.py
View file @
5aa104bf
...
@@ -301,8 +301,12 @@ def permalink(content):
...
@@ -301,8 +301,12 @@ def permalink(content):
def
extend_content
(
content
):
def
extend_content
(
content
):
roles
=
{}
roles
=
{}
if
content
.
get
(
'user_id'
):
if
content
.
get
(
'user_id'
):
user
=
User
.
objects
.
get
(
pk
=
content
[
'user_id'
])
try
:
roles
=
dict
((
'name'
,
role
.
name
.
lower
())
for
role
in
user
.
roles
.
filter
(
course_id
=
content
[
'course_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'
]))
except
user
.
DoesNotExist
:
logging
.
error
(
'User ID {0} in comment content {1} but not in our DB.'
.
format
(
content
.
get
(
'user_id'
),
content
.
get
(
'id'
)))
content_info
=
{
content_info
=
{
'displayed_title'
:
content
.
get
(
'highlighted_title'
)
or
content
.
get
(
'title'
,
''
),
'displayed_title'
:
content
.
get
(
'highlighted_title'
)
or
content
.
get
(
'title'
,
''
),
'displayed_body'
:
content
.
get
(
'highlighted_body'
)
or
content
.
get
(
'body'
,
''
),
'displayed_body'
:
content
.
get
(
'highlighted_body'
)
or
content
.
get
(
'body'
,
''
),
...
...
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