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
115eebdb
Commit
115eebdb
authored
Aug 24, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use reverse for course_info url replacement
parent
31216ccd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
lms/djangoapps/courseware/courses.py
+2
-1
lms/urls.py
+2
-0
No files found.
lms/djangoapps/courseware/courses.py
View file @
115eebdb
...
@@ -5,6 +5,7 @@ import logging
...
@@ -5,6 +5,7 @@ import logging
from
path
import
path
from
path
import
path
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.http
import
Http404
from
django.http
import
Http404
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.course_module
import
CourseDescriptor
...
@@ -137,7 +138,7 @@ def get_course_info_section(course, section_key):
...
@@ -137,7 +138,7 @@ def get_course_info_section(course, section_key):
info_html
=
replace_urls
(
htmlFile
.
read
()
.
decode
(
'utf-8'
),
course
.
metadata
[
'data_dir'
])
info_html
=
replace_urls
(
htmlFile
.
read
()
.
decode
(
'utf-8'
),
course
.
metadata
[
'data_dir'
])
# Replace '/course/' urls
# Replace '/course/' urls
course_root
=
'/courses/'
+
course
.
location
.
course_id
course_root
=
reverse
(
'course_root'
,
args
=
[
course
.
id
])[:
-
1
]
# Remove trailing slash
info_html
=
replace_urls
(
info_html
,
course_root
,
'/course/'
)
info_html
=
replace_urls
(
info_html
,
course_root
,
'/course/'
)
return
info_html
return
info_html
except
ResourceNotFoundError
:
except
ResourceNotFoundError
:
...
...
lms/urls.py
View file @
115eebdb
...
@@ -124,6 +124,8 @@ if settings.COURSEWARE_ENABLED:
...
@@ -124,6 +124,8 @@ if settings.COURSEWARE_ENABLED:
'courseware.views.course_about'
,
name
=
"about_course"
),
'courseware.views.course_about'
,
name
=
"about_course"
),
#Inside the course
#Inside the course
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/$'
,
'courseware.views.course_info'
,
name
=
"course_root"
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/info$'
,
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/info$'
,
'courseware.views.course_info'
,
name
=
"info"
),
'courseware.views.course_info'
,
name
=
"info"
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/syllabus$'
,
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/syllabus$'
,
...
...
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