Skip to content

Commit

Permalink
Merge pull request #693 from edx/hammad/ENT-2550
Browse files Browse the repository at this point in the history
ENT-2550 | capture enterprise customer info in manual enrollments
  • Loading branch information
HammadAhmadWaqas authored Jan 31, 2020
2 parents fb3cdb2 + 7b84093 commit c1cf053
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Change Log

.. There should always be an "Unreleased" section for changes pending release.
[2.3.1] - 2020-01-29
---------------------

* Updated calls to `manual enrollments api` to include enterprise customer info

[2.3.0] - 2020-01-29
--------------------

Expand Down
2 changes: 1 addition & 1 deletion enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

from __future__ import absolute_import, unicode_literals

__version__ = "2.3.0"
__version__ = "2.3.1"

default_app_config = "enterprise.apps.EnterpriseConfig" # pylint: disable=invalid-name
5 changes: 4 additions & 1 deletion enterprise/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ def _enroll_users(
notify: Whether to notify (by email) the users that have been enrolled
"""
pending_messages = []
succeeded = []
paid_modes = ['verified', 'professional']

if course_id:
Expand Down Expand Up @@ -883,7 +884,9 @@ def _enroll_users(
"email": success.email,
"username": success.username,
"course_run_key": course_id,
"discount_percentage": float(discount)
"discount_percentage": float(discount),
"enterprise_customer_name": enterprise_customer.name,
"enterprise_customer_uuid": str(enterprise_customer.uuid),
} for success in succeeded]
if mode in paid_modes:
# Create an order to track the manual enrollments of non-pending accounts
Expand Down
2 changes: 2 additions & 0 deletions enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,8 @@ def create_order_for_enrollment(self, course_run_id):
'username': self.username,
'email': self.user_email,
'course_run_key': course_run_id,
"enterprise_customer_name": self.enterprise_customer.name,
"enterprise_customer_uuid": str(self.enterprise_customer.uuid),
}]
ecommerce_api_client.create_manual_enrollment_orders(course_enrollments)
else:
Expand Down

0 comments on commit c1cf053

Please sign in to comment.