Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
08a961d6
Commit
08a961d6
authored
6 years ago
by
Alex Dusenbery
Committed by
Alex Dusenbery
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
EDUCATOR-2618 | Add more function_trace() to inline discussion view.
parent
246ebc14
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/discussion/views.py
+26
-19
26 additions, 19 deletions
lms/djangoapps/discussion/views.py
with
26 additions
and
19 deletions
lms/djangoapps/discussion/views.py
+
26
−
19
View file @
08a961d6
...
...
@@ -192,31 +192,38 @@ def inline_discussion(request, course_key, discussion_id):
Renders JSON for DiscussionModules
"""
course
=
get_course_with_access
(
request
.
user
,
'
load
'
,
course_key
,
check_if_enrolled
=
True
)
cc_user
=
cc
.
User
.
from_django_user
(
request
.
user
)
user_info
=
cc_user
.
to_dict
()
with
function_trace
(
'
get_course_and_user_info
'
):
course
=
get_course_with_access
(
request
.
user
,
'
load
'
,
course_key
,
check_if_enrolled
=
True
)
cc_user
=
cc
.
User
.
from_django_user
(
request
.
user
)
user_info
=
cc_user
.
to_dict
()
try
:
threads
,
query_params
=
get_threads
(
request
,
course
,
user_info
,
discussion_id
,
per_page
=
INLINE_THREADS_PER_PAGE
)
with
function_trace
(
'
get_threads
'
):
threads
,
query_params
=
get_threads
(
request
,
course
,
user_info
,
discussion_id
,
per_page
=
INLINE_THREADS_PER_PAGE
)
except
ValueError
:
return
HttpResponseServerError
(
"
Invalid group_id
"
)
return
HttpResponseServerError
(
'
Invalid group_id
'
)
with
function_trace
(
"
get_metadata_for_threads
"
):
with
function_trace
(
'
get_metadata_for_threads
'
):
annotated_content_info
=
utils
.
get_metadata_for_threads
(
course_key
,
threads
,
request
.
user
,
user_info
)
is_staff
=
has_permission
(
request
.
user
,
'
openclose_thread
'
,
course
.
id
)
course_discussion_settings
=
get_course_discussion_settings
(
course
.
id
)
group_names_by_id
=
get_group_names_by_id
(
course_discussion_settings
)
course_is_divided
=
course_discussion_settings
.
division_scheme
is
not
CourseDiscussionSettings
.
NONE
threads
=
[
utils
.
prepare_content
(
thread
,
course_key
,
is_staff
,
course_is_divided
,
group_names_by_id
)
for
thread
in
threads
]
with
function_trace
(
'
determine_group_permissions
'
):
is_staff
=
has_permission
(
request
.
user
,
'
openclose_thread
'
,
course
.
id
)
course_discussion_settings
=
get_course_discussion_settings
(
course
.
id
)
group_names_by_id
=
get_group_names_by_id
(
course_discussion_settings
)
course_is_divided
=
course_discussion_settings
.
division_scheme
is
not
CourseDiscussionSettings
.
NONE
with
function_trace
(
'
prepare_content
'
):
threads
=
[
utils
.
prepare_content
(
thread
,
course_key
,
is_staff
,
course_is_divided
,
group_names_by_id
)
for
thread
in
threads
]
return
utils
.
JsonResponse
({
'
is_commentable_divided
'
:
is_commentable_divided
(
course_key
,
discussion_id
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment