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
fdd045b1
Commit
fdd045b1
authored
Apr 25, 2016
by
Matt Drayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mattdrayer: Add microsite settings overrides
parent
f53b900f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
openedx/core/djangoapps/commerce/utils.py
+7
-3
No files found.
openedx/core/djangoapps/commerce/utils.py
View file @
fdd045b1
...
...
@@ -3,6 +3,8 @@ from django.conf import settings
from
edx_rest_api_client.client
import
EdxRestApiClient
from
eventtracking
import
tracker
from
openedx.core.djangoapps.theming
import
helpers
ECOMMERCE_DATE_FORMAT
=
"
%
Y-
%
m-
%
dT
%
H:
%
M:
%
SZ"
...
...
@@ -23,14 +25,16 @@ def is_commerce_service_configured():
Return a Boolean indicating whether or not configuration is present to use
the external commerce service.
"""
return
bool
(
settings
.
ECOMMERCE_API_URL
and
settings
.
ECOMMERCE_API_SIGNING_KEY
)
ecommerce_api_url
=
helpers
.
get_value
(
"ECOMMERCE_API_URL"
,
settings
.
ECOMMERCE_API_URL
)
ecommerce_api_signing_key
=
helpers
.
get_value
(
"ECOMMERCE_API_SIGNING_KEY"
,
settings
.
ECOMMERCE_API_SIGNING_KEY
)
return
bool
(
ecommerce_api_url
and
ecommerce_api_signing_key
)
def
ecommerce_api_client
(
user
):
""" Returns an E-Commerce API client setup with authentication for the specified user. """
return
EdxRestApiClient
(
settings
.
ECOMMERCE_API_URL
,
settings
.
ECOMMERCE_API_SIGNING_KEY
,
helpers
.
get_value
(
"ECOMMERCE_API_URL"
,
settings
.
ECOMMERCE_API_URL
)
,
helpers
.
get_value
(
"ECOMMERCE_API_SIGNING_KEY"
,
settings
.
ECOMMERCE_API_SIGNING_KEY
)
,
user
.
username
,
user
.
profile
.
name
if
hasattr
(
user
,
'profile'
)
else
None
,
user
.
email
,
...
...
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