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
e5f97b37
Commit
e5f97b37
authored
Jun 28, 2013
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8 fixes
parent
b1424a75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
lms/djangoapps/django_comment_client/forum/views.py
+9
-9
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
e5f97b37
...
...
@@ -114,7 +114,7 @@ def inline_discussion(request, course_id, discussion_id):
threads
,
query_params
=
get_threads
(
request
,
course_id
,
discussion_id
,
per_page
=
INLINE_THREADS_PER_PAGE
)
cc_user
=
cc
.
User
.
from_django_user
(
request
.
user
)
user_info
=
cc_user
.
to_dict
()
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
):
# TODO (vshnayder): since none of this code seems to be aware of the fact that
# sometimes things go wrong, I suspect that the js client is also not
# checking for errors on request. Check and fix as needed.
...
...
@@ -141,8 +141,8 @@ def inline_discussion(request, course_id, discussion_id):
if
is_moderator
:
cohorts
=
get_course_cohorts
(
course_id
)
for
c
in
cohorts
:
cohorts_list
.
append
({
'name'
:
c
.
name
,
'id'
:
c
.
id
})
for
c
ohort
in
cohorts
:
cohorts_list
.
append
({
'name'
:
c
ohort
.
name
,
'id'
:
cohort
.
id
})
else
:
#students don't get to choose
...
...
@@ -174,11 +174,11 @@ def forum_form_discussion(request, course_id):
try
:
unsafethreads
,
query_params
=
get_threads
(
request
,
course_id
)
# This might process a search query
threads
=
[
utils
.
safe_content
(
thread
)
for
thread
in
unsafethreads
]
except
(
cc
.
utils
.
CommentClientMaintenanceError
)
as
er
r
:
except
cc
.
utils
.
CommentClientMaintenanceErro
r
:
log
.
warning
(
"Forum is in maintenance mode"
)
return
render_to_response
(
'discussion/maintenance.html'
,
{})
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
log
.
error
(
"Error loading forum discussion threads:
%
s"
%
str
(
err
))
log
.
error
(
"Error loading forum discussion threads:
%
s"
,
str
(
err
))
raise
Http404
user
=
cc
.
User
.
from_django_user
(
request
.
user
)
...
...
@@ -244,7 +244,7 @@ def single_thread(request, course_id, discussion_id, thread_id):
try
:
thread
=
cc
.
Thread
.
find
(
thread_id
)
.
retrieve
(
recursive
=
True
,
user_id
=
request
.
user
.
id
)
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
):
log
.
error
(
"Error loading single thread."
)
raise
Http404
...
...
@@ -269,7 +269,7 @@ def single_thread(request, course_id, discussion_id, thread_id):
try
:
threads
,
query_params
=
get_threads
(
request
,
course_id
)
threads
.
append
(
thread
.
to_dict
())
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
):
log
.
error
(
"Error loading single thread."
)
raise
Http404
...
...
@@ -369,7 +369,7 @@ def user_profile(request, course_id, user_id):
}
return
render_to_response
(
'discussion/user_profile.html'
,
context
)
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
,
User
.
DoesNotExist
)
as
err
:
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
,
User
.
DoesNotExist
):
raise
Http404
...
...
@@ -412,5 +412,5 @@ def followed_threads(request, course_id, user_id):
}
return
render_to_response
(
'discussion/user_profile.html'
,
context
)
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
,
User
.
DoesNotExist
)
as
err
:
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
,
User
.
DoesNotExist
):
raise
Http404
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