Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
40611acf
Commit
40611acf
authored
5 years ago
by
DawoudSheraz
Browse files
Options
Downloads
Patches
Plain Diff
render content and log the error when getting sibling urls
parent
6d2ed9d8
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
cms/djangoapps/contentstore/utils.py
+13
-6
13 additions, 6 deletions
cms/djangoapps/contentstore/utils.py
with
13 additions
and
6 deletions
cms/djangoapps/contentstore/utils.py
+
13
−
6
View file @
40611acf
...
...
@@ -550,7 +550,7 @@ def get_sibling_urls(subsection):
# section.get_parent SHOULD return the course, but for some reason, it might not
sections
=
section
.
get_parent
().
get_children
()
except
AttributeError
:
log
.
error
(
u
"
Error retrieving URLs in
subsection {subsection} included in section {section}
"
.
format
(
log
.
error
(
u
"
URL Retrieval Error # 1:
subsection {subsection} included in section {section}
"
.
format
(
section
=
section
.
location
,
subsection
=
subsection
.
location
))
...
...
@@ -563,12 +563,19 @@ def get_sibling_urls(subsection):
except
IndexError
:
pass
if
not
next_loc
:
sections
=
section
.
get_parent
().
get_children
()
try
:
next_section
=
sections
[
sections
.
index
(
section
)
+
1
]
next_loc
=
next_section
.
get_children
()[
0
].
get_children
()[
0
].
location
except
IndexError
:
pass
sections
=
section
.
get_parent
().
get_children
()
except
AttributeError
:
log
.
error
(
u
"
URL Retrieval Error # 2: subsection {subsection} included in section {section}
"
.
format
(
section
=
section
.
location
,
subsection
=
subsection
.
location
))
else
:
try
:
next_section
=
sections
[
sections
.
index
(
section
)
+
1
]
next_loc
=
next_section
.
get_children
()[
0
].
get_children
()[
0
].
location
except
IndexError
:
pass
if
prev_loc
:
prev_url
=
reverse_usage_url
(
'
container_handler
'
,
prev_loc
)
if
next_loc
:
...
...
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