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

Automated command for deletion of unverified users #3386

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tsu-ki
Copy link
Contributor

@tsu-ki tsu-ki commented Feb 11, 2025

Closes: #3387

Test run without making changes

python manage.py cleanup_unverified_users --dry-run

Actually run the cleanup

python manage.py cleanup_unverified_users

image

@CodeWithBishal
Copy link
Contributor

CodeWithBishal commented Feb 12, 2025

can we have atleast a week and 2 reminder emails before it automatically deleting an account?
python manage.py cleanup_unverified_users
will it remove all the unverified users or just a particular user?

if all the users will be removed, will it check the accounts that are getting deleted got the mails & it's past 1 week since the first reminder and remove only those who fulfils the criteria?

  • First reminder to be sent 1 week before deletion
  • Second reminder 24 hours before deletion

@tsu-ki
Copy link
Contributor Author

tsu-ki commented Feb 12, 2025

can we have atleast a week and 2 reminder emails before it automatically deleting an account? python manage.py cleanup_unverified_users will it remove all the unverified users or just a particular user?

if all the users will be removed, will it check the accounts that are getting deleted got the mails & it's past 1 week since the first reminder and remove only those who fulfils the criteria?

  • First reminder to be sent 1 week before deletion
  • Second reminder 24 hours before deletion
  • current implementation sends a reminder mail 24 hours after the account has been created. If the user doesn't verifies their account between 24 hours to 48 hours window, their account gets deleted after that.
  • python manage.py cleanup_unverified_users removes all unverified users except admins, staff, superusers, members from an organization or if the user's email is from owasp.org domain.
  • I haven't add the cross verification function yet. I'll add this aswell, thanks for your suggestion

@DonnieBLT
Copy link
Collaborator

there is an issue with sending emails to everyone, what if the users were spam signups and these are people's real email addresses that they didn't sign up with?

Copy link
Collaborator

@DonnieBLT DonnieBLT left a comment

Choose a reason for hiding this comment

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

I think for the first time we run this we need a different approach.

@tsu-ki
Copy link
Contributor Author

tsu-ki commented Feb 16, 2025

I think for the first time we run this we need a different approach.

@DonnieBLT sir, that approach should I follow for the first execution?

@DonnieBLT
Copy link
Collaborator

I think for the first time we run this we need a different approach.

@DonnieBLT sir, that approach should I follow for the first execution?

Print a list . The following 100 users have not verified their email. Then have a flag auto_delete=false

@tsu-ki
Copy link
Contributor Author

tsu-ki commented Feb 16, 2025

I think for the first time we run this we need a different approach.

@DonnieBLT sir, that approach should I follow for the first execution?

Print a list . The following 100 users have not verified their email. Then have a flag auto_delete=false

okay, so in the first execution there won't be any automatic deletion but rather just print a list of unverified users?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Django Management command for deleting unverified users
3 participants