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
ada86232
Commit
ada86232
authored
Dec 13, 2017
by
Douglas Hall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENT-798 Update SailThru user with enterprise name on EnterpriseCustomerUser creation.
parent
39757aa5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
openedx/features/enterprise_support/signals.py
+9
-3
openedx/features/enterprise_support/tests/test_signals.py
+7
-1
No files found.
openedx/features/enterprise_support/signals.py
View file @
ada86232
...
...
@@ -11,11 +11,17 @@ from email_marketing.tasks import update_user # pylint: disable=import-error
@receiver
(
post_save
,
sender
=
EnterpriseCustomerUser
)
def
update_email_marketing_user_with_enterprise_
flag
(
sender
,
instance
,
**
kwargs
):
# pylint: disable=unused-argument, invalid-name
def
update_email_marketing_user_with_enterprise_
vars
(
sender
,
instance
,
**
kwargs
):
# pylint: disable=unused-argument, invalid-name
"""
Enable the is_enterprise_learner flag in SailThru
vars.
Update the SailThru user with enterprise-related
vars.
"""
user
=
User
.
objects
.
get
(
id
=
instance
.
user_id
)
# perform update asynchronously
update_user
.
delay
(
sailthru_vars
=
{
'is_enterprise_learner'
:
True
},
email
=
user
.
email
)
update_user
.
delay
(
sailthru_vars
=
{
'is_enterprise_learner'
:
True
,
'enterprise_name'
:
instance
.
enterprise_customer
.
name
,
},
email
=
user
.
email
)
openedx/features/enterprise_support/tests/test_signals.py
View file @
ada86232
...
...
@@ -34,4 +34,10 @@ class EnterpriseSupportSignals(TestCase):
user_id
=
self
.
user
.
id
,
enterprise_customer
=
enterprise_customer
)
self
.
assertTrue
(
mock_update_user
.
called
)
mock_update_user
.
assert_called_with
(
sailthru_vars
=
{
'is_enterprise_learner'
:
True
,
'enterprise_name'
:
enterprise_customer
.
name
,
},
email
=
self
.
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