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
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
a6fc27ac
Commit
a6fc27ac
authored
12 years ago
by
Victor Shnayder
Browse files
Options
Downloads
Patches
Plain Diff
Fix accordion rendering bug
* needed to clean the chapter and section vars before rendering
parent
e061e864
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/courseware/views.py
+5
-4
5 additions, 4 deletions
lms/djangoapps/courseware/views.py
with
5 additions
and
4 deletions
lms/djangoapps/courseware/views.py
+
5
−
4
View file @
a6fc27ac
...
@@ -256,15 +256,13 @@ def index(request, course=None, chapter=None, section=None,
...
@@ -256,15 +256,13 @@ def index(request, course=None, chapter=None, section=None,
{
'
content
'
: module-error message}
{
'
content
'
: module-error message}
'''
'''
# Can't modify variables of outer scope, so need new ones
# Can't modify variables of outer scope, so need new ones
chapter_
=
clean
(
chapter
)
section_
=
clean
(
section
)
user
=
request
.
user
user
=
request
.
user
module_xml
=
get_module_xml
(
user
,
course
,
chapter
_
,
section
_
)
module_xml
=
get_module_xml
(
user
,
course
,
chapter
,
section
)
if
module_xml
is
None
:
if
module_xml
is
None
:
log
.
exception
(
"
couldn
'
t get module_xml: course/chapter/section:
'
%s/%s/%s
'"
,
log
.
exception
(
"
couldn
'
t get module_xml: course/chapter/section:
'
%s/%s/%s
'"
,
course
,
chapter
_
,
section
_
)
course
,
chapter
,
section
)
return
{
'
content
'
:
render_to_string
(
"
module-error.html
"
,
{})}
return
{
'
content
'
:
render_to_string
(
"
module-error.html
"
,
{})}
student_module_cache
=
preload_student_modules
(
module_xml
)
student_module_cache
=
preload_student_modules
(
module_xml
)
...
@@ -289,6 +287,9 @@ def index(request, course=None, chapter=None, section=None,
...
@@ -289,6 +287,9 @@ def index(request, course=None, chapter=None, section=None,
# keep track of current course being viewed in django's request.session
# keep track of current course being viewed in django's request.session
request
.
session
[
'
coursename
'
]
=
course
request
.
session
[
'
coursename
'
]
=
course
chapter
=
clean
(
chapter
)
section
=
clean
(
section
)
context
=
{
context
=
{
'
csrf
'
:
csrf
(
request
)[
'
csrf_token
'
],
'
csrf
'
:
csrf
(
request
)[
'
csrf_token
'
],
'
accordion
'
:
render_accordion
(
request
,
course
,
chapter
,
section
),
'
accordion
'
:
render_accordion
(
request
,
course
,
chapter
,
section
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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