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
197c06a1
Commit
197c06a1
authored
Aug 25, 2017
by
Uman Shahzad
Committed by
Jesse Shapiro
Aug 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump edx-enterprise to 0.41.0.
This incorporates a migration that copies data from certain models to another.
parent
0a6029f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
common/djangoapps/enrollment/tests/test_views.py
+7
-0
common/djangoapps/enrollment/views.py
+10
-3
requirements/edx/base.txt
+1
-1
No files found.
common/djangoapps/enrollment/tests/test_views.py
View file @
197c06a1
...
@@ -966,9 +966,15 @@ class EnrollmentTest(EnrollmentTestMixin, ModuleStoreTestCase, APITestCase, Ente
...
@@ -966,9 +966,15 @@ class EnrollmentTest(EnrollmentTestMixin, ModuleStoreTestCase, APITestCase, Ente
self
.
assertTrue
(
is_active
)
self
.
assertTrue
(
is_active
)
self
.
assertEqual
(
course_mode
,
updated_mode
)
self
.
assertEqual
(
course_mode
,
updated_mode
)
@override_settings
(
ENTERPRISE_SERVICE_WORKER_USERNAME
=
'enterprise_worker'
)
@override_settings
(
ENABLE_ENTERPRISE_INTEGRATION
=
True
)
@override_settings
(
ENABLE_ENTERPRISE_INTEGRATION
=
True
)
def
test_enterprise_course_enrollment_invalid_consent
(
self
):
def
test_enterprise_course_enrollment_invalid_consent
(
self
):
"""Verify that the enterprise_course_consent must be a boolean. """
"""Verify that the enterprise_course_consent must be a boolean. """
UserFactory
.
create
(
username
=
'enterprise_worker'
,
email
=
self
.
EMAIL
,
password
=
self
.
PASSWORD
,
)
CourseModeFactory
.
create
(
CourseModeFactory
.
create
(
course_id
=
self
.
course
.
id
,
course_id
=
self
.
course
.
id
,
mode_slug
=
CourseMode
.
DEFAULT_MODE_SLUG
,
mode_slug
=
CourseMode
.
DEFAULT_MODE_SLUG
,
...
@@ -1056,6 +1062,7 @@ class EnrollmentTest(EnrollmentTestMixin, ModuleStoreTestCase, APITestCase, Ente
...
@@ -1056,6 +1062,7 @@ class EnrollmentTest(EnrollmentTestMixin, ModuleStoreTestCase, APITestCase, Ente
'course_id'
:
unicode
(
self
.
course
.
id
),
'course_id'
:
unicode
(
self
.
course
.
id
),
'ec_uuid'
:
'this-is-a-real-uuid'
'ec_uuid'
:
'this-is-a-real-uuid'
}
}
self
.
mock_enterprise_course_enrollment_post_api
()
self
.
mock_consent_missing
(
**
consent_kwargs
)
self
.
mock_consent_missing
(
**
consent_kwargs
)
self
.
mock_consent_post
(
**
consent_kwargs
)
self
.
mock_consent_post
(
**
consent_kwargs
)
self
.
assert_enrollment_status
(
self
.
assert_enrollment_status
(
...
...
common/djangoapps/enrollment/views.py
View file @
197c06a1
...
@@ -597,15 +597,22 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
...
@@ -597,15 +597,22 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
enterprise_course_consent
=
request
.
data
.
get
(
'enterprise_course_consent'
)
enterprise_course_consent
=
request
.
data
.
get
(
'enterprise_course_consent'
)
explicit_linked_enterprise
=
request
.
data
.
get
(
'linked_enterprise_customer'
)
explicit_linked_enterprise
=
request
.
data
.
get
(
'linked_enterprise_customer'
)
if
has_api_key_permissions
and
enterprise_enabled
():
if
(
enterprise_course_consent
or
explicit_linked_enterprise
)
and
has_api_key_permissions
and
enterprise_enabled
():
enterprise_api_client
=
EnterpriseApiClient
()
consent_client
=
ConsentApiClient
()
# We received an explicitly-linked EnterpriseCustomer for the enrollment
# We received an explicitly-linked EnterpriseCustomer for the enrollment
if
explicit_linked_enterprise
is
not
None
:
if
explicit_linked_enterprise
is
not
None
:
try
:
enterprise_api_client
.
post_enterprise_course_enrollment
(
username
,
unicode
(
course_id
),
True
)
except
EnterpriseApiException
as
error
:
log
.
exception
(
"An unexpected error occurred while creating the new EnterpriseCourseEnrollment "
"for user [
%
s] in course run [
%
s]"
,
username
,
course_id
)
raise
CourseEnrollmentError
(
error
.
message
)
kwargs
=
{
kwargs
=
{
'username'
:
username
,
'username'
:
username
,
'course_id'
:
unicode
(
course_id
),
'course_id'
:
unicode
(
course_id
),
'enterprise_customer_uuid'
:
explicit_linked_enterprise
,
'enterprise_customer_uuid'
:
explicit_linked_enterprise
,
}
}
consent_client
=
ConsentApiClient
()
consent_client
.
provide_consent
(
**
kwargs
)
consent_client
.
provide_consent
(
**
kwargs
)
# We received an implicit "consent granted" parameter from ecommerce
# We received an implicit "consent granted" parameter from ecommerce
...
@@ -623,7 +630,7 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
...
@@ -623,7 +630,7 @@ class EnrollmentListView(APIView, ApiKeyPermissionMixIn):
}
}
)
)
try
:
try
:
EnterpriseApiClient
()
.
post_enterprise_course_enrollment
(
enterprise_api_client
.
post_enterprise_course_enrollment
(
username
,
username
,
unicode
(
course_id
),
unicode
(
course_id
),
enterprise_course_consent
enterprise_course_consent
...
...
requirements/edx/base.txt
View file @
197c06a1
...
@@ -48,7 +48,7 @@ edx-lint==0.4.3
...
@@ -48,7 +48,7 @@ edx-lint==0.4.3
astroid==1.3.8
astroid==1.3.8
edx-django-oauth2-provider==1.1.4
edx-django-oauth2-provider==1.1.4
edx-django-sites-extensions==2.3.0
edx-django-sites-extensions==2.3.0
edx-enterprise==0.4
0.7
edx-enterprise==0.4
1.0
edx-oauth2-provider==1.2.0
edx-oauth2-provider==1.2.0
edx-opaque-keys==0.4.0
edx-opaque-keys==0.4.0
edx-organizations==0.4.6
edx-organizations==0.4.6
...
...
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