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
4bec871b
Commit
4bec871b
authored
Jan 02, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't return BadRequest classes, return instances
parent
8e0d218c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
cms/djangoapps/contentstore/course_info_model.py
+3
-3
cms/djangoapps/contentstore/views.py
+2
-2
No files found.
cms/djangoapps/contentstore/course_info_model.py
View file @
4bec871b
...
...
@@ -57,7 +57,7 @@ def update_course_updates(location, update, passed_id=None):
try
:
course_updates
=
modulestore
(
'direct'
)
.
get_item
(
location
)
except
ItemNotFoundError
:
return
HttpResponseBadRequest
return
HttpResponseBadRequest
()
# purely to handle free formed updates not done via editor. Actually kills them, but at least doesn't break.
try
:
...
...
@@ -95,12 +95,12 @@ def delete_course_update(location, update, passed_id):
Returns the resulting course_updates b/c their ids change.
"""
if
not
passed_id
:
return
HttpResponseBadRequest
return
HttpResponseBadRequest
()
try
:
course_updates
=
modulestore
(
'direct'
)
.
get_item
(
location
)
except
ItemNotFoundError
:
return
HttpResponseBadRequest
return
HttpResponseBadRequest
()
# TODO use delete_blank_text parser throughout and cache as a static var in a class
# purely to handle free formed updates not done via editor. Actually kills them, but at least doesn't break.
...
...
cms/djangoapps/contentstore/views.py
View file @
4bec871b
...
...
@@ -204,7 +204,7 @@ def edit_subsection(request, location):
# make sure that location references a 'sequential', otherwise return BadRequest
if
item
.
location
.
category
!=
'sequential'
:
return
HttpResponseBadRequest
return
HttpResponseBadRequest
()
parent_locs
=
modulestore
()
.
get_parent_locations
(
location
)
...
...
@@ -1021,7 +1021,7 @@ def module_info(request, module_location):
elif
real_method
==
'POST'
or
real_method
==
'PUT'
:
return
HttpResponse
(
json
.
dumps
(
set_module_info
(
get_modulestore
(
location
),
location
,
request
.
POST
)),
mimetype
=
"application/json"
)
else
:
return
HttpResponseBadRequest
return
HttpResponseBadRequest
()
@login_required
@ensure_csrf_cookie
...
...
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