Skip to content

Commit

Permalink
Fix 500 error from Ecommerce client sites setup API (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsadDevAI authored May 27, 2021
1 parent 05a067c commit 8fa3f16
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'fonts',
'colors',
'platform_name',
'oscar_from_address',
'oscar_from_email',
'panel_notification_base_url',
'contact_mailing_address',
'theme_dir_name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ def setUp(self):
platform_name='Edly',
theme_dir_name='st-lutherx-ecommerce',
oauth_clients={
'ecom-sso': {
'id': 'ecom-sso-id',
'secret': 'ecom-sso-secret',
'payments-sso': {
'id': 'payments-sso-id',
'secret': 'payments-sso-secret',
},
'ecom-backend': {
'id': 'ecom-backend-id',
'secret': 'ecom-backend-secret',
'payments-backend': {
'id': 'payments-backend-id',
'secret': 'payments-backend-secret',
},
},
oscar_from_address='edly@example.com',
oscar_from_email='edly@example.com',
panel_notification_base_url='panel.backend.edly.devstack.lms:9090',
contact_mailing_address='edly@example.com',
)
Expand All @@ -153,7 +153,7 @@ def test_without_authentication(self):
"""
self.client.logout()
response = self.client.post(self.edly_sites_url)
assert response.status_code == status.HTTP_403_FORBIDDEN
assert response.status_code == status.HTTP_401_UNAUTHORIZED

def test_without_permission(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions ecommerce/extensions/edly_ecommerce_app/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def get_oauth2_credentials(self):
Returns payments SSO and backend OAuth2 values.
"""
oauth2_clients = self.request.data.get('oauth2_clients', {})
payments_sso_values = oauth2_clients.get('ecom-sso', {})
payments_backend_values = oauth2_clients.get('ecom-backend', {})
payments_sso_values = oauth2_clients.get('payments-sso', {})
payments_backend_values = oauth2_clients.get('payments-backend', {})
oauth2_values = dict(
SOCIAL_AUTH_EDX_OAUTH2_KEY=payments_sso_values.get('id', ''),
SOCIAL_AUTH_EDX_OAUTH2_SECRET=payments_sso_values.get('secret', ''),
Expand Down
14 changes: 7 additions & 7 deletions ecommerce/extensions/edly_ecommerce_app/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ def setUp(self):
platform_name='Edly',
theme_dir_name='st-lutherx-ecommerce',
oauth_clients={
'ecom-sso': {
'id': 'ecom-sso-id',
'secret': 'ecom-sso-secret',
'payments-sso': {
'id': 'payments-sso-id',
'secret': 'payments-sso-secret',
},
'ecom-backend': {
'id': 'ecom-backend-id',
'secret': 'ecom-backend-secret',
'payments-backend': {
'id': 'payments-backend-id',
'secret': 'payments-backend-secret',
},
},
oscar_from_address='edly@example.com',
oscar_from_email='edly@example.com',
panel_notification_base_url='panel.backend.edly.devstack.lms:9090',
contact_mailing_address='edly@example.com',
)
Expand Down

0 comments on commit 8fa3f16

Please sign in to comment.