Skip to content
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

List users email #446

Merged
merged 7 commits into from
Aug 22, 2023
Merged

List users email #446

merged 7 commits into from
Aug 22, 2023

Conversation

juagargi
Copy link
Member

@juagargi juagargi commented Jul 26, 2023

Adds a command to list the users email addresses and send them an email.
To be used for service announcements.


This change is Reviewable

Copy link
Contributor

@FR4NK-W FR4NK-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 10 files reviewed, 5 unresolved discussions / 0 of 1 LGTMs obtained / 0 of 1 approvals obtained


scionlab/management/commands/mass_email.py line 27 at r1 (raw file):

class Command(BaseCommand):
    help = 'List the unique emails of the users in alphabetical order'

Suggestion:

List or send a message to

scionlab/management/commands/mass_email.py line 38 at r1 (raw file):

destinataries

recipients ?


scionlab/management/commands/mass_email.py line 59 at r1 (raw file):

is_anonymous

This is always going to be false here


scionlab/management/commands/mass_email.py line 61 at r1 (raw file):

is_authenticated

This is always going to be true here


scionlab/management/commands/mass_email.py line 73 at r1 (raw file):

    def send(self, **kwargs):
        print('send email')

Suggestion:

print('sending email(s)')

Copy link
Member Author

@juagargi juagargi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 10 files reviewed, 5 unresolved discussions / 0 of 1 LGTMs obtained / 0 of 1 approvals obtained


scionlab/management/commands/mass_email.py line 27 at r1 (raw file):

class Command(BaseCommand):
    help = 'List the unique emails of the users in alphabetical order'

Done.


scionlab/management/commands/mass_email.py line 38 at r1 (raw file):

Previously, FR4NK-W wrote…

destinataries

recipients ?

Done. Replaced all in file.


scionlab/management/commands/mass_email.py line 59 at r1 (raw file):

Previously, FR4NK-W wrote…

is_anonymous

This is always going to be false here

Done.


scionlab/management/commands/mass_email.py line 61 at r1 (raw file):

Previously, FR4NK-W wrote…

is_authenticated

This is always going to be true here

Done.


scionlab/management/commands/mass_email.py line 73 at r1 (raw file):

    def send(self, **kwargs):
        print('send email')

Done (leftover)

The command can now list users and send email directly.
Because we don't know the exact size of the batch size
that the SMTP server accepts, we must allow to configure it,
and when reached, send a new email.
Better help message for the mass email command.
Replace the word destinatary with recipient.
Remove unnecessary conditions is_anonymous or is_authenticated for objects of
the User model (which are always identified and authenticated).
@juagargi juagargi force-pushed the juagargi/list_users_email branch from 0c4888b to d4dd517 Compare August 17, 2023 08:47
@juagargi juagargi marked this pull request as ready for review August 17, 2023 08:47
Copy link
Contributor

@FR4NK-W FR4NK-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 10 files at r1, 1 of 1 files at r2, 8 of 8 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


scionlab/management/commands/mass_email.py line 55 at r3 (raw file):

        # report user stats:
        anon = []
        unauth = []

Left overs


scionlab/management/commands/mass_email.py line 64 at r3 (raw file):

                active.append(u)
        print(f'--------------------------- anonymous: {len(anon)}')
        print(f'--------------------------- unauthorized: {len(unauth)}')

same

Copy link
Contributor

@FR4NK-W FR4NK-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


scionlab/management/commands/mass_email.py line 55 at r5 (raw file):

        # report user stats:
        anon = []
        unauth = []

Unused


scionlab/management/commands/mass_email.py line 64 at r5 (raw file):

                active.append(u)
        print(f'--------------------------- anonymous: {len(anon)}')
        print(f'--------------------------- unauthorized: {len(unauth)}')

Copy link
Contributor

@FR4NK-W FR4NK-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@juagargi juagargi merged commit baa026d into develop Aug 22, 2023
@juagargi juagargi deleted the juagargi/list_users_email branch August 22, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants