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
7e96f668
Commit
7e96f668
authored
Sep 11, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render courseware context after creating a new post.
parent
ce16d224
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
lms/djangoapps/django_comment_client/base/views.py
+8
-3
No files found.
lms/djangoapps/django_comment_client/base/views.py
View file @
7e96f668
...
...
@@ -22,7 +22,7 @@ from django.contrib.auth.models import User
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
courseware.courses
import
get_course_with_access
from
django_comment_client.utils
import
JsonResponse
,
JsonError
,
extract
from
django_comment_client.utils
import
JsonResponse
,
JsonError
,
extract
,
get_courseware_context
from
django_comment_client.permissions
import
check_permissions_by_view
from
django_comment_client.models
import
Role
...
...
@@ -74,10 +74,15 @@ def create_thread(request, course_id, commentable_id):
if
post
.
get
(
'auto_subscribe'
,
'false'
)
.
lower
()
==
'true'
:
user
=
cc
.
User
.
from_django_user
(
request
.
user
)
user
.
follow
(
thread
)
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
courseware_context
=
get_courseware_context
(
thread
,
course
)
data
=
thread
.
to_dict
()
if
courseware_context
:
data
.
update
(
courseware_context
)
if
request
.
is_ajax
():
return
ajax_content_response
(
request
,
course_id
,
thread
.
to_dict
()
,
'discussion/ajax_create_thread.html'
)
return
ajax_content_response
(
request
,
course_id
,
data
,
'discussion/ajax_create_thread.html'
)
else
:
return
JsonResponse
(
utils
.
safe_content
(
thread
.
to_dict
()
))
return
JsonResponse
(
utils
.
safe_content
(
data
))
@require_POST
@login_required
...
...
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