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
2cb2e5e3
Commit
2cb2e5e3
authored
Oct 25, 2017
by
Matthew Piatetsky
Committed by
GitHub
Oct 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16344 from edx/LEARNER-2412
Fix request to currency endpoint
parents
df89a1d2
e1c24084
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
common/djangoapps/course_modes/views.py
+6
-2
openedx/core/djangoapps/catalog/utils.py
+1
-1
No files found.
common/djangoapps/course_modes/views.py
View file @
2cb2e5e3
...
@@ -3,6 +3,7 @@ Views for the course_mode module
...
@@ -3,6 +3,7 @@ Views for the course_mode module
"""
"""
import
decimal
import
decimal
import
json
import
urllib
import
urllib
import
waffle
import
waffle
...
@@ -190,8 +191,11 @@ class ChooseModeView(View):
...
@@ -190,8 +191,11 @@ class ChooseModeView(View):
context
[
'currency_data'
]
=
[]
context
[
'currency_data'
]
=
[]
if
waffle
.
switch_is_active
(
'local_currency'
):
if
waffle
.
switch_is_active
(
'local_currency'
):
if
'edx-price-l10n'
not
in
request
.
COOKIES
:
if
'edx-price-l10n'
not
in
request
.
COOKIES
:
context
[
'currency_data'
]
=
get_currency_data
()
currency_data
=
get_currency_data
()
try
:
context
[
'currency_data'
]
=
json
.
dumps
(
currency_data
)
except
TypeError
:
pass
return
render_to_response
(
"course_modes/choose.html"
,
context
)
return
render_to_response
(
"course_modes/choose.html"
,
context
)
@method_decorator
(
tpa_hint_ends_existing_session
)
@method_decorator
(
tpa_hint_ends_existing_session
)
...
...
openedx/core/djangoapps/catalog/utils.py
View file @
2cb2e5e3
...
@@ -136,7 +136,7 @@ def get_currency_data():
...
@@ -136,7 +136,7 @@ def get_currency_data():
api
=
create_catalog_api_client
(
user
)
api
=
create_catalog_api_client
(
user
)
cache_key
=
'{base}.currency'
.
format
(
base
=
catalog_integration
.
CACHE_KEY
)
cache_key
=
'{base}.currency'
.
format
(
base
=
catalog_integration
.
CACHE_KEY
)
return
get_edx_api_data
(
catalog_integration
,
'currency'
,
api
=
api
,
return
get_edx_api_data
(
catalog_integration
,
'currency'
,
api
=
api
,
traverse_pagination
=
False
,
cache_key
=
cache_key
if
catalog_integration
.
is_cache_enabled
else
None
)
cache_key
=
cache_key
if
catalog_integration
.
is_cache_enabled
else
None
)
else
:
else
:
return
[]
return
[]
...
...
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