Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
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
ecommerce
Commits
782f2f29
Commit
782f2f29
authored
May 21, 2018
by
christopher lee
Committed by
Christopher Lee
May 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary logic in coupon utils
parent
588cca27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
22 deletions
+7
-22
ecommerce/coupons/utils.py
+7
-22
No files found.
ecommerce/coupons/utils.py
View file @
782f2f29
...
...
@@ -7,7 +7,7 @@ from django.core.cache import cache
from
oscar.core.loading
import
get_model
from
slumber.exceptions
import
HttpNotFoundError
from
ecommerce.core.utils
import
get_cache_key
,
traverse_pagination
from
ecommerce.core.utils
import
get_cache_key
Product
=
get_model
(
'catalogue'
,
'Product'
)
...
...
@@ -70,27 +70,12 @@ def get_catalog_course_runs(site, query, limit=None, offset=None):
if
not
response
:
api
=
site
.
siteconfiguration
.
discovery_api_client
endpoint
=
getattr
(
api
,
api_resource_name
)
if
limit
:
response
=
endpoint
()
.
get
(
partner
=
partner_code
,
q
=
query
,
limit
=
limit
,
offset
=
offset
)
else
:
response
=
endpoint
()
.
get
(
partner
=
partner_code
,
q
=
query
)
all_response_results
=
traverse_pagination
(
response
,
endpoint
)
response
=
{
'count'
:
len
(
all_response_results
),
'next'
:
'None'
,
'previous'
:
'None'
,
'results'
:
all_response_results
,
}
response
=
endpoint
()
.
get
(
partner
=
partner_code
,
q
=
query
,
limit
=
limit
,
offset
=
offset
)
cache
.
set
(
cache_key
,
response
,
settings
.
COURSES_API_CACHE_TIMEOUT
)
return
response
...
...
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