-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: send group membership invite and remove emails #2049
Conversation
c81d313
to
ce8c357
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, the right direction. I think we need to think about which membership records we're pulling from the DB and we can simplify down some of the resulting logic given we have access to the pending learner record
ce8c357
to
90655a6
Compare
99d85cf
to
cca442b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great so far- one comment on filtering for only pending learners in group and unit tests but otherwise on the right track 👍
cca442b
to
a8fb110
Compare
a422304
to
12481f5
Compare
feat: send group membership invite, remove, and reminder emails feat: send group membership invite, remove, and reminder emails feat: send group membership invite, remove, and reminder emails fix: file name chore: refactored chore: refactored chore: refactored sending group reminder email to realized learners fix: deleted unused file chore: update fix: updated tests chore: removed comment chore: removed empty line
12481f5
to
b61b4e6
Compare
11d16c5
to
b61b4e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, couple small suggestions for simplicity and performance improvements.
# ecus: enterprise customer users | ||
ecus = [] | ||
# Gather all existing User objects associated with the email batch | ||
existing_users = User.objects.filter(email__in=user_email_batch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a red flag to me based on all the problems Alex has with filtering and querying the User table and it taking so long. I would look into this PR and see what he's doing with the SQL string https://github.com/openedx/edx-enterprise/pull/2057/files#diff-d950991245f878f58adc157895d6431af4385d522ab994aa25726e9abc2b434dR4274
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though he was doing email__icontains
and not email__in
which would be faster but maybe it should be something more like the _get_filtered_ecu_ids
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I did a little poking around - grabbed the sql query from the queryset and ran it against prod
mysql> SELECT auth_user.id,
-> auth_user.password,
-> auth_user.last_login,
-> auth_user.is_superuser,
-> auth_user.username,
-> auth_user.first_name,
-> auth_user.last_name,
-> auth_user.email,
-> auth_user.is_staff,
-> auth_user.is_active,
-> auth_user.date_joined
-> FROM auth_user
-> WHERE auth_user.email IN ( "[email protected]", "[email protected]" );
+----------+--------------------------------------------------------------------------------+----------------------------+--------------+----------+------------+-----------+-------------------+----------+-----------+---------------------+
| id | password | last_login | is_superuser | username | first_name | last_name | email | is_staff | is_active | date_joined |
+----------+--------------------------------------------------------------------------------+----------------------------+--------------+----------+------------+-----------+-------------------+----------+-----------+---------------------+
| 40294834 | pbkdf2_sha256$150000$x6piOQTpY9TT$bgr29MbJEahwaqOEXfAoqpFPYndM4v29SSoQYZCVYPU= | 2021-03-11 06:05:35.793195 | 0 | ---2 | | | [email protected] | 0 | 0 | 2021-03-11 06:05:35 |
+----------+--------------------------------------------------------------------------------+----------------------------+--------------+----------+------------+-----------+-------------------+----------+-----------+---------------------+
1 row in set (0.00 sec)
I thiiink this shows it's running in a reasonable time but we should def test once it goes out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts - let me know if you want to discuss
# ecus: enterprise customer users | ||
ecus = [] | ||
# Gather all existing User objects associated with the email batch | ||
existing_users = User.objects.filter(email__in=user_email_batch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I did a little poking around - grabbed the sql query from the queryset and ran it against prod
mysql> SELECT auth_user.id,
-> auth_user.password,
-> auth_user.last_login,
-> auth_user.is_superuser,
-> auth_user.username,
-> auth_user.first_name,
-> auth_user.last_name,
-> auth_user.email,
-> auth_user.is_staff,
-> auth_user.is_active,
-> auth_user.date_joined
-> FROM auth_user
-> WHERE auth_user.email IN ( "[email protected]", "[email protected]" );
+----------+--------------------------------------------------------------------------------+----------------------------+--------------+----------+------------+-----------+-------------------+----------+-----------+---------------------+
| id | password | last_login | is_superuser | username | first_name | last_name | email | is_staff | is_active | date_joined |
+----------+--------------------------------------------------------------------------------+----------------------------+--------------+----------+------------+-----------+-------------------+----------+-----------+---------------------+
| 40294834 | pbkdf2_sha256$150000$x6piOQTpY9TT$bgr29MbJEahwaqOEXfAoqpFPYndM4v29SSoQYZCVYPU= | 2021-03-11 06:05:35.793195 | 0 | ---2 | | | [email protected] | 0 | 0 | 2021-03-11 06:05:35 |
+----------+--------------------------------------------------------------------------------+----------------------------+--------------+----------+------------+-----------+-------------------+----------+-----------+---------------------+
1 row in set (0.00 sec)
I thiiink this shows it's running in a reasonable time but we should def test once it goes out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small nits/changes but otherwise looks good to me!
Add tasks for group membership invites and removal. The reminder emails will be done in
enterprise-access
Braze templates:
https://2u-internal.atlassian.net/browse/ENT-8504
Merge checklist:
requirements/*.txt
files)base.in
if needed in production but edx-platform doesn't install ittest-master.in
if edx-platform pins it, with a matching versionmake upgrade && make requirements
have been run to regenerate requirementsmake static
has been run to update webpack bundling if any static content was updated./manage.py makemigrations
has been run./manage.py lms makemigrations
in the shell.Post merge:
(so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
make upgrade
in edx-platform will look for the latest version in PyPi.