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
e3ddb02c
Commit
e3ddb02c
authored
Feb 25, 2016
by
John Eskew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11586 from edx/jeskew/remove_all_request_dot_request
Remove all request.REQUEST usages.
parents
db5fe130
df261cd5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
42 additions
and
38 deletions
+42
-38
cms/djangoapps/contentstore/views/assets.py
+6
-6
cms/djangoapps/contentstore/views/component.py
+1
-1
cms/djangoapps/contentstore/views/course.py
+3
-3
cms/djangoapps/contentstore/views/entrance_exam.py
+1
-1
cms/djangoapps/contentstore/views/import_export.py
+1
-1
cms/djangoapps/contentstore/views/item.py
+10
-10
cms/djangoapps/contentstore/views/library.py
+1
-1
common/djangoapps/external_auth/views.py
+6
-4
lms/djangoapps/instructor_task/tests/test_base.py
+1
-1
lms/djangoapps/instructor_task/tests/test_views.py
+7
-5
lms/djangoapps/instructor_task/views.py
+4
-4
lms/djangoapps/shoppingcart/views.py
+1
-1
No files found.
cms/djangoapps/contentstore/views/assets.py
View file @
e3ddb02c
...
@@ -61,7 +61,7 @@ def assets_handler(request, course_key_string=None, asset_key_string=None):
...
@@ -61,7 +61,7 @@ def assets_handler(request, course_key_string=None, asset_key_string=None):
if
not
has_course_author_access
(
request
.
user
,
course_key
):
if
not
has_course_author_access
(
request
.
user
,
course_key
):
raise
PermissionDenied
()
raise
PermissionDenied
()
response_format
=
request
.
REQUEST
.
get
(
'format'
,
'html'
)
response_format
=
request
.
GET
.
get
(
'format'
)
or
request
.
POST
.
get
(
'format'
)
or
'html'
if
response_format
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
):
if
response_format
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
):
if
request
.
method
==
'GET'
:
if
request
.
method
==
'GET'
:
return
_assets_json
(
request
,
course_key
)
return
_assets_json
(
request
,
course_key
)
...
@@ -97,10 +97,10 @@ def _assets_json(request, course_key):
...
@@ -97,10 +97,10 @@ def _assets_json(request, course_key):
Supports start (0-based index into the list of assets) and max query parameters.
Supports start (0-based index into the list of assets) and max query parameters.
"""
"""
requested_page
=
int
(
request
.
REQUES
T
.
get
(
'page'
,
0
))
requested_page
=
int
(
request
.
GE
T
.
get
(
'page'
,
0
))
requested_page_size
=
int
(
request
.
REQUES
T
.
get
(
'page_size'
,
50
))
requested_page_size
=
int
(
request
.
GE
T
.
get
(
'page_size'
,
50
))
requested_sort
=
request
.
REQUES
T
.
get
(
'sort'
,
'date_added'
)
requested_sort
=
request
.
GE
T
.
get
(
'sort'
,
'date_added'
)
requested_filter
=
request
.
REQUES
T
.
get
(
'asset_type'
,
''
)
requested_filter
=
request
.
GE
T
.
get
(
'asset_type'
,
''
)
requested_file_types
=
settings
.
FILES_AND_UPLOAD_TYPE_FILTERS
.
get
(
requested_file_types
=
settings
.
FILES_AND_UPLOAD_TYPE_FILTERS
.
get
(
requested_filter
,
None
)
requested_filter
,
None
)
filter_params
=
None
filter_params
=
None
...
@@ -124,7 +124,7 @@ def _assets_json(request, course_key):
...
@@ -124,7 +124,7 @@ def _assets_json(request, course_key):
}
}
sort_direction
=
DESCENDING
sort_direction
=
DESCENDING
if
request
.
REQUES
T
.
get
(
'direction'
,
''
)
.
lower
()
==
'asc'
:
if
request
.
GE
T
.
get
(
'direction'
,
''
)
.
lower
()
==
'asc'
:
sort_direction
=
ASCENDING
sort_direction
=
ASCENDING
# Convert the field name to the Mongo name
# Convert the field name to the Mongo name
...
...
cms/djangoapps/contentstore/views/component.py
View file @
e3ddb02c
...
@@ -96,7 +96,7 @@ def container_handler(request, usage_key_string):
...
@@ -96,7 +96,7 @@ def container_handler(request, usage_key_string):
component_templates
=
get_component_templates
(
course
)
component_templates
=
get_component_templates
(
course
)
ancestor_xblocks
=
[]
ancestor_xblocks
=
[]
parent
=
get_parent_xblock
(
xblock
)
parent
=
get_parent_xblock
(
xblock
)
action
=
request
.
REQUES
T
.
get
(
'action'
,
'view'
)
action
=
request
.
GE
T
.
get
(
'action'
,
'view'
)
is_unit_page
=
is_unit
(
xblock
)
is_unit_page
=
is_unit
(
xblock
)
unit
=
xblock
if
is_unit_page
else
None
unit
=
xblock
if
is_unit_page
else
None
...
...
cms/djangoapps/contentstore/views/course.py
View file @
e3ddb02c
...
@@ -164,7 +164,7 @@ def course_notifications_handler(request, course_key_string=None, action_state_i
...
@@ -164,7 +164,7 @@ def course_notifications_handler(request, course_key_string=None, action_state_i
if
not
course_key_string
or
not
action_state_id
:
if
not
course_key_string
or
not
action_state_id
:
return
HttpResponseBadRequest
()
return
HttpResponseBadRequest
()
response_format
=
request
.
REQUEST
.
get
(
'format'
,
'html'
)
response_format
=
request
.
GET
.
get
(
'format'
)
or
request
.
POST
.
get
(
'format'
)
or
'html'
course_key
=
CourseKey
.
from_string
(
course_key_string
)
course_key
=
CourseKey
.
from_string
(
course_key_string
)
...
@@ -250,7 +250,7 @@ def course_handler(request, course_key_string=None):
...
@@ -250,7 +250,7 @@ def course_handler(request, course_key_string=None):
json: delete this branch from this course (leaving off /branch/draft would imply delete the course)
json: delete this branch from this course (leaving off /branch/draft would imply delete the course)
"""
"""
try
:
try
:
response_format
=
request
.
REQUEST
.
get
(
'format'
,
'html'
)
response_format
=
request
.
GET
.
get
(
'format'
)
or
request
.
POST
.
get
(
'format'
)
or
'html'
if
response_format
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
):
if
response_format
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
):
if
request
.
method
==
'GET'
:
if
request
.
method
==
'GET'
:
course_key
=
CourseKey
.
from_string
(
course_key_string
)
course_key
=
CourseKey
.
from_string
(
course_key_string
)
...
@@ -582,7 +582,7 @@ def course_index(request, course_key):
...
@@ -582,7 +582,7 @@ def course_index(request, course_key):
reindex_link
=
"/course/{course_id}/search_reindex"
.
format
(
course_id
=
unicode
(
course_key
))
reindex_link
=
"/course/{course_id}/search_reindex"
.
format
(
course_id
=
unicode
(
course_key
))
sections
=
course_module
.
get_children
()
sections
=
course_module
.
get_children
()
course_structure
=
_course_outline_json
(
request
,
course_module
)
course_structure
=
_course_outline_json
(
request
,
course_module
)
locator_to_show
=
request
.
REQUES
T
.
get
(
'show'
,
None
)
locator_to_show
=
request
.
GE
T
.
get
(
'show'
,
None
)
course_release_date
=
get_default_time_display
(
course_module
.
start
)
if
course_module
.
start
!=
DEFAULT_START_DATE
else
_
(
"Unscheduled"
)
course_release_date
=
get_default_time_display
(
course_module
.
start
)
if
course_module
.
start
!=
DEFAULT_START_DATE
else
_
(
"Unscheduled"
)
settings_url
=
reverse_course_url
(
'settings_handler'
,
course_key
)
settings_url
=
reverse_course_url
(
'settings_handler'
,
course_key
)
...
...
cms/djangoapps/contentstore/views/entrance_exam.py
View file @
e3ddb02c
...
@@ -83,7 +83,7 @@ def entrance_exam(request, course_key_string):
...
@@ -83,7 +83,7 @@ def entrance_exam(request, course_key_string):
# Create a new entrance exam for the specified course (returns 201 if created)
# Create a new entrance exam for the specified course (returns 201 if created)
elif
request
.
method
==
'POST'
:
elif
request
.
method
==
'POST'
:
response_format
=
request
.
REQUE
ST
.
get
(
'format'
,
'html'
)
response_format
=
request
.
PO
ST
.
get
(
'format'
,
'html'
)
http_accept
=
request
.
META
.
get
(
'http_accept'
)
http_accept
=
request
.
META
.
get
(
'http_accept'
)
if
response_format
==
'json'
or
'application/json'
in
http_accept
:
if
response_format
==
'json'
or
'application/json'
in
http_accept
:
ee_min_score
=
request
.
POST
.
get
(
'entrance_exam_minimum_score_pct'
,
None
)
ee_min_score
=
request
.
POST
.
get
(
'entrance_exam_minimum_score_pct'
,
None
)
...
...
cms/djangoapps/contentstore/views/import_export.py
View file @
e3ddb02c
...
@@ -498,7 +498,7 @@ def export_handler(request, course_key_string):
...
@@ -498,7 +498,7 @@ def export_handler(request, course_key_string):
context
[
'export_url'
]
=
export_url
+
'?_accept=application/x-tgz'
context
[
'export_url'
]
=
export_url
+
'?_accept=application/x-tgz'
# an _accept URL parameter will be preferred over HTTP_ACCEPT in the header.
# an _accept URL parameter will be preferred over HTTP_ACCEPT in the header.
requested_format
=
request
.
REQUES
T
.
get
(
'_accept'
,
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'text/html'
))
requested_format
=
request
.
GE
T
.
get
(
'_accept'
,
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'text/html'
))
if
'application/x-tgz'
in
requested_format
:
if
'application/x-tgz'
in
requested_format
:
try
:
try
:
...
...
cms/djangoapps/contentstore/views/item.py
View file @
e3ddb02c
...
@@ -140,7 +140,7 @@ def xblock_handler(request, usage_key_string):
...
@@ -140,7 +140,7 @@ def xblock_handler(request, usage_key_string):
accept_header
=
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
)
accept_header
=
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
)
if
'application/json'
in
accept_header
:
if
'application/json'
in
accept_header
:
fields
=
request
.
REQUES
T
.
get
(
'fields'
,
''
)
.
split
(
','
)
fields
=
request
.
GE
T
.
get
(
'fields'
,
''
)
.
split
(
','
)
if
'graderType'
in
fields
:
if
'graderType'
in
fields
:
# right now can't combine output of this w/ output of _get_module_info, but worthy goal
# right now can't combine output of this w/ output of _get_module_info, but worthy goal
return
JsonResponse
(
CourseGradingModel
.
get_section_grader_type
(
usage_key
))
return
JsonResponse
(
CourseGradingModel
.
get_section_grader_type
(
usage_key
))
...
@@ -254,24 +254,24 @@ def xblock_view_handler(request, usage_key_string, view_name):
...
@@ -254,24 +254,24 @@ def xblock_view_handler(request, usage_key_string, view_name):
paging
=
None
paging
=
None
try
:
try
:
if
request
.
REQUES
T
.
get
(
'enable_paging'
,
'false'
)
==
'true'
:
if
request
.
GE
T
.
get
(
'enable_paging'
,
'false'
)
==
'true'
:
paging
=
{
paging
=
{
'page_number'
:
int
(
request
.
REQUES
T
.
get
(
'page_number'
,
0
)),
'page_number'
:
int
(
request
.
GE
T
.
get
(
'page_number'
,
0
)),
'page_size'
:
int
(
request
.
REQUES
T
.
get
(
'page_size'
,
0
)),
'page_size'
:
int
(
request
.
GE
T
.
get
(
'page_size'
,
0
)),
}
}
except
ValueError
:
except
ValueError
:
return
HttpResponse
(
return
HttpResponse
(
content
=
"Couldn't parse paging parameters: enable_paging: "
content
=
"Couldn't parse paging parameters: enable_paging: "
"{0}, page_number: {1}, page_size: {2}"
.
format
(
"{0}, page_number: {1}, page_size: {2}"
.
format
(
request
.
REQUES
T
.
get
(
'enable_paging'
,
'false'
),
request
.
GE
T
.
get
(
'enable_paging'
,
'false'
),
request
.
REQUES
T
.
get
(
'page_number'
,
0
),
request
.
GE
T
.
get
(
'page_number'
,
0
),
request
.
REQUES
T
.
get
(
'page_size'
,
0
)
request
.
GE
T
.
get
(
'page_size'
,
0
)
),
),
status
=
400
,
status
=
400
,
content_type
=
"text/plain"
,
content_type
=
"text/plain"
,
)
)
force_render
=
request
.
REQUES
T
.
get
(
'force_render'
,
None
)
force_render
=
request
.
GE
T
.
get
(
'force_render'
,
None
)
# Set up the context to be passed to each XBlock's render method.
# Set up the context to be passed to each XBlock's render method.
context
=
{
context
=
{
...
@@ -325,7 +325,7 @@ def xblock_outline_handler(request, usage_key_string):
...
@@ -325,7 +325,7 @@ def xblock_outline_handler(request, usage_key_string):
if
not
has_studio_read_access
(
request
.
user
,
usage_key
.
course_key
):
if
not
has_studio_read_access
(
request
.
user
,
usage_key
.
course_key
):
raise
PermissionDenied
()
raise
PermissionDenied
()
response_format
=
request
.
REQUES
T
.
get
(
'format'
,
'html'
)
response_format
=
request
.
GE
T
.
get
(
'format'
,
'html'
)
if
response_format
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
):
if
response_format
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
):
store
=
modulestore
()
store
=
modulestore
()
with
store
.
bulk_operations
(
usage_key
.
course_key
):
with
store
.
bulk_operations
(
usage_key
.
course_key
):
...
@@ -354,7 +354,7 @@ def xblock_container_handler(request, usage_key_string):
...
@@ -354,7 +354,7 @@ def xblock_container_handler(request, usage_key_string):
if
not
has_studio_read_access
(
request
.
user
,
usage_key
.
course_key
):
if
not
has_studio_read_access
(
request
.
user
,
usage_key
.
course_key
):
raise
PermissionDenied
()
raise
PermissionDenied
()
response_format
=
request
.
REQUES
T
.
get
(
'format'
,
'html'
)
response_format
=
request
.
GE
T
.
get
(
'format'
,
'html'
)
if
response_format
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
):
if
response_format
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
):
with
modulestore
()
.
bulk_operations
(
usage_key
.
course_key
):
with
modulestore
()
.
bulk_operations
(
usage_key
.
course_key
):
response
=
_get_module_info
(
response
=
_get_module_info
(
...
...
cms/djangoapps/contentstore/views/library.py
View file @
e3ddb02c
...
@@ -86,7 +86,7 @@ def _display_library(library_key_string, request):
...
@@ -86,7 +86,7 @@ def _display_library(library_key_string, request):
response_format
=
'html'
response_format
=
'html'
if
(
if
(
request
.
REQUES
T
.
get
(
'format'
,
'html'
)
==
'json'
or
request
.
GE
T
.
get
(
'format'
,
'html'
)
==
'json'
or
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'text/html'
)
'application/json'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'text/html'
)
):
):
response_format
=
'json'
response_format
=
'json'
...
...
common/djangoapps/external_auth/views.py
View file @
e3ddb02c
...
@@ -756,7 +756,10 @@ def provider_login(request):
...
@@ -756,7 +756,10 @@ def provider_login(request):
# first check to see if the request is an OpenID request.
# first check to see if the request is an OpenID request.
# If so, the client will have specified an 'openid.mode' as part
# If so, the client will have specified an 'openid.mode' as part
# of the request.
# of the request.
querydict
=
dict
(
request
.
REQUEST
.
items
())
if
request
.
method
==
'GET'
:
querydict
=
dict
(
request
.
GET
.
items
())
else
:
querydict
=
dict
(
request
.
POST
.
items
())
error
=
False
error
=
False
if
'openid.mode'
in
request
.
GET
or
'openid.mode'
in
request
.
POST
:
if
'openid.mode'
in
request
.
GET
or
'openid.mode'
in
request
.
POST
:
# decode request
# decode request
...
@@ -899,9 +902,8 @@ def provider_login(request):
...
@@ -899,9 +902,8 @@ def provider_login(request):
return
HttpResponseRedirect
(
openid_request_url
)
return
HttpResponseRedirect
(
openid_request_url
)
# determine consumer domain if applicable
# determine consumer domain if applicable
return_to
=
''
return_to
=
request
.
GET
.
get
(
'openid.return_to'
)
or
request
.
POST
.
get
(
'openid.return_to'
)
or
''
if
'openid.return_to'
in
request
.
REQUEST
:
if
return_to
:
return_to
=
request
.
REQUEST
[
'openid.return_to'
]
matches
=
re
.
match
(
r'\w+:\/\/([\w\.-]+)'
,
return_to
)
matches
=
re
.
match
(
r'\w+:\/\/([\w\.-]+)'
,
return_to
)
return_to
=
matches
.
group
(
1
)
return_to
=
matches
.
group
(
1
)
...
...
lms/djangoapps/instructor_task/tests/test_base.py
View file @
e3ddb02c
...
@@ -176,7 +176,7 @@ class InstructorTaskCourseTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase)
...
@@ -176,7 +176,7 @@ class InstructorTaskCourseTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase)
def
get_task_status
(
task_id
):
def
get_task_status
(
task_id
):
"""Use api method to fetch task status, using mock request."""
"""Use api method to fetch task status, using mock request."""
mock_request
=
Mock
()
mock_request
=
Mock
()
mock_request
.
REQUE
ST
=
{
'task_id'
:
task_id
}
mock_request
.
GET
=
mock_request
.
PO
ST
=
{
'task_id'
:
task_id
}
response
=
instructor_task_status
(
mock_request
)
response
=
instructor_task_status
(
mock_request
)
status
=
json
.
loads
(
response
.
content
)
status
=
json
.
loads
(
response
.
content
)
return
status
return
status
...
...
lms/djangoapps/instructor_task/tests/test_views.py
View file @
e3ddb02c
...
@@ -7,7 +7,7 @@ from celery.states import SUCCESS, FAILURE, REVOKED, PENDING
...
@@ -7,7 +7,7 @@ from celery.states import SUCCESS, FAILURE, REVOKED, PENDING
from
mock
import
Mock
,
patch
from
mock
import
Mock
,
patch
from
django.
utils.datastructures
import
MultiValue
Dict
from
django.
http
import
Query
Dict
from
instructor_task.models
import
PROGRESS
from
instructor_task.models
import
PROGRESS
from
instructor_task.tests.test_base
import
(
InstructorTaskTestCase
,
from
instructor_task.tests.test_base
import
(
InstructorTaskTestCase
,
...
@@ -24,14 +24,14 @@ class InstructorTaskReportTest(InstructorTaskTestCase):
...
@@ -24,14 +24,14 @@ class InstructorTaskReportTest(InstructorTaskTestCase):
def
_get_instructor_task_status
(
self
,
task_id
):
def
_get_instructor_task_status
(
self
,
task_id
):
"""Returns status corresponding to task_id via api method."""
"""Returns status corresponding to task_id via api method."""
request
=
Mock
()
request
=
Mock
()
request
.
REQUE
ST
=
{
'task_id'
:
task_id
}
request
.
GET
=
request
.
PO
ST
=
{
'task_id'
:
task_id
}
return
instructor_task_status
(
request
)
return
instructor_task_status
(
request
)
def
test_instructor_task_status
(
self
):
def
test_instructor_task_status
(
self
):
instructor_task
=
self
.
_create_failure_entry
()
instructor_task
=
self
.
_create_failure_entry
()
task_id
=
instructor_task
.
task_id
task_id
=
instructor_task
.
task_id
request
=
Mock
()
request
=
Mock
()
request
.
REQUE
ST
=
{
'task_id'
:
task_id
}
request
.
GET
=
request
.
PO
ST
=
{
'task_id'
:
task_id
}
response
=
instructor_task_status
(
request
)
response
=
instructor_task_status
(
request
)
output
=
json
.
loads
(
response
.
content
)
output
=
json
.
loads
(
response
.
content
)
self
.
assertEquals
(
output
[
'task_id'
],
task_id
)
self
.
assertEquals
(
output
[
'task_id'
],
task_id
)
...
@@ -39,7 +39,7 @@ class InstructorTaskReportTest(InstructorTaskTestCase):
...
@@ -39,7 +39,7 @@ class InstructorTaskReportTest(InstructorTaskTestCase):
def
test_missing_instructor_task_status
(
self
):
def
test_missing_instructor_task_status
(
self
):
task_id
=
"missing_id"
task_id
=
"missing_id"
request
=
Mock
()
request
=
Mock
()
request
.
REQUE
ST
=
{
'task_id'
:
task_id
}
request
.
GET
=
request
.
PO
ST
=
{
'task_id'
:
task_id
}
response
=
instructor_task_status
(
request
)
response
=
instructor_task_status
(
request
)
output
=
json
.
loads
(
response
.
content
)
output
=
json
.
loads
(
response
.
content
)
self
.
assertEquals
(
output
,
{})
self
.
assertEquals
(
output
,
{})
...
@@ -50,7 +50,9 @@ class InstructorTaskReportTest(InstructorTaskTestCase):
...
@@ -50,7 +50,9 @@ class InstructorTaskReportTest(InstructorTaskTestCase):
# list data, so the key value has "[]" appended to it.
# list data, so the key value has "[]" appended to it.
task_ids
=
[(
self
.
_create_failure_entry
())
.
task_id
for
_
in
range
(
1
,
5
)]
task_ids
=
[(
self
.
_create_failure_entry
())
.
task_id
for
_
in
range
(
1
,
5
)]
request
=
Mock
()
request
=
Mock
()
request
.
REQUEST
=
MultiValueDict
({
'task_ids[]'
:
task_ids
})
task_ids_query_dict
=
QueryDict
(
mutable
=
True
)
task_ids_query_dict
.
update
({
'task_ids[]'
:
task_ids
})
request
.
GET
=
request
.
POST
=
task_ids_query_dict
response
=
instructor_task_status
(
request
)
response
=
instructor_task_status
(
request
)
output
=
json
.
loads
(
response
.
content
)
output
=
json
.
loads
(
response
.
content
)
self
.
assertEquals
(
len
(
output
),
len
(
task_ids
))
self
.
assertEquals
(
len
(
output
),
len
(
task_ids
))
...
...
lms/djangoapps/instructor_task/views.py
View file @
e3ddb02c
...
@@ -76,11 +76,11 @@ def instructor_task_status(request):
...
@@ -76,11 +76,11 @@ def instructor_task_status(request):
"""
"""
output
=
{}
output
=
{}
if
'task_id'
in
request
.
REQUEST
:
task_id
=
request
.
GET
.
get
(
'task_id'
)
or
request
.
POST
.
get
(
'task_id'
)
task_id
=
request
.
REQUEST
[
'task_id'
]
tasks
=
request
.
GET
.
get
(
'task_ids[]'
)
or
request
.
POST
.
get
(
'task_ids[]'
)
if
task_id
:
output
=
_get_instructor_task_status
(
task_id
)
output
=
_get_instructor_task_status
(
task_id
)
elif
'task_ids[]'
in
request
.
REQUEST
:
elif
tasks
:
tasks
=
request
.
REQUEST
.
getlist
(
'task_ids[]'
)
for
task_id
in
tasks
:
for
task_id
in
tasks
:
task_output
=
_get_instructor_task_status
(
task_id
)
task_output
=
_get_instructor_task_status
(
task_id
)
if
task_output
is
not
None
:
if
task_output
is
not
None
:
...
...
lms/djangoapps/shoppingcart/views.py
View file @
e3ddb02c
...
@@ -217,7 +217,7 @@ def remove_item(request):
...
@@ -217,7 +217,7 @@ def remove_item(request):
"""
"""
This will remove an item from the user cart and also delete the corresponding coupon codes redemption.
This will remove an item from the user cart and also delete the corresponding coupon codes redemption.
"""
"""
item_id
=
request
.
REQUEST
.
get
(
'id'
,
'-1'
)
item_id
=
request
.
GET
.
get
(
'id'
)
or
request
.
POST
.
get
(
'id'
)
or
'-1'
items
=
OrderItem
.
objects
.
filter
(
id
=
item_id
,
status
=
'cart'
)
.
select_subclasses
()
items
=
OrderItem
.
objects
.
filter
(
id
=
item_id
,
status
=
'cart'
)
.
select_subclasses
()
...
...
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