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
8991cdd3
Commit
8991cdd3
authored
Dec 17, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop raising BaseExceptions
parent
7977491d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
cms/djangoapps/contentstore/utils.py
+2
-2
common/djangoapps/static_replace.py
+1
-1
common/lib/xmodule/xmodule/modulestore/mongo.py
+2
-2
No files found.
cms/djangoapps/contentstore/utils.py
View file @
8991cdd3
...
@@ -37,10 +37,10 @@ def get_course_location_for_item(location):
...
@@ -37,10 +37,10 @@ def get_course_location_for_item(location):
# make sure we found exactly one match on this above course search
# make sure we found exactly one match on this above course search
found_cnt
=
len
(
courses
)
found_cnt
=
len
(
courses
)
if
found_cnt
==
0
:
if
found_cnt
==
0
:
raise
Base
Exception
(
'Could not find course at {0}'
.
format
(
course_search_location
))
raise
Exception
(
'Could not find course at {0}'
.
format
(
course_search_location
))
if
found_cnt
>
1
:
if
found_cnt
>
1
:
raise
Base
Exception
(
'Found more than one course at {0}. There should only be one!!! Dump = {1}'
.
format
(
course_search_location
,
courses
))
raise
Exception
(
'Found more than one course at {0}. There should only be one!!! Dump = {1}'
.
format
(
course_search_location
,
courses
))
location
=
courses
[
0
]
.
location
location
=
courses
[
0
]
.
location
...
...
common/djangoapps/static_replace.py
View file @
8991cdd3
...
@@ -49,7 +49,7 @@ def replace(static_url, prefix=None, course_namespace=None):
...
@@ -49,7 +49,7 @@ def replace(static_url, prefix=None, course_namespace=None):
# use the utility functions in StaticContent.py
# use the utility functions in StaticContent.py
if
static_url
.
group
(
'prefix'
)
==
'/static/'
and
not
isinstance
(
modulestore
(),
XMLModuleStore
):
if
static_url
.
group
(
'prefix'
)
==
'/static/'
and
not
isinstance
(
modulestore
(),
XMLModuleStore
):
if
course_namespace
is
None
:
if
course_namespace
is
None
:
raise
Base
Exception
(
'You must pass in course_namespace when remapping static content urls with MongoDB stores'
)
raise
Exception
(
'You must pass in course_namespace when remapping static content urls with MongoDB stores'
)
url
=
StaticContent
.
convert_legacy_static_url
(
static_url
.
group
(
'rest'
),
course_namespace
)
url
=
StaticContent
.
convert_legacy_static_url
(
static_url
.
group
(
'rest'
),
course_namespace
)
else
:
else
:
url
=
try_staticfiles_lookup
(
prefix
+
static_url
.
group
(
'rest'
))
url
=
try_staticfiles_lookup
(
prefix
+
static_url
.
group
(
'rest'
))
...
...
common/lib/xmodule/xmodule/modulestore/mongo.py
View file @
8991cdd3
...
@@ -314,10 +314,10 @@ class MongoModuleStore(ModuleStoreBase):
...
@@ -314,10 +314,10 @@ class MongoModuleStore(ModuleStoreBase):
# make sure we found exactly one match on this above course search
# make sure we found exactly one match on this above course search
found_cnt
=
len
(
courses
)
found_cnt
=
len
(
courses
)
if
found_cnt
==
0
:
if
found_cnt
==
0
:
raise
Base
Exception
(
'Could not find course at {0}'
.
format
(
course_search_location
))
raise
Exception
(
'Could not find course at {0}'
.
format
(
course_search_location
))
if
found_cnt
>
1
:
if
found_cnt
>
1
:
raise
Base
Exception
(
'Found more than one course at {0}. There should only be one!!! Dump = {1}'
.
format
(
course_search_location
,
courses
))
raise
Exception
(
'Found more than one course at {0}. There should only be one!!! Dump = {1}'
.
format
(
course_search_location
,
courses
))
return
courses
[
0
]
return
courses
[
0
]
...
...
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