Skip to content

Conversation

@ihsaan-ullah
Copy link
Collaborator

@ihsaan-ullah ihsaan-ullah commented Jun 18, 2025

@Didayolo

Description

Sometimes users create accounts and do not activate them. To keep our db clean we want to delete the non activated users who have created accounts but have not activated their accounts for more than 3 days. The auto-task will run every 24 hours to check for such accounts and will delete them

Issues this PR resolves

A checklist for hand testing

  • change the time of task in base.py to maybe 5 minutes to test locally
'clean_non_activated_users': {
        'task': 'profiles.tasks.clean_non_activated_users',
        'schedule': timedelta(minutes=5),  # Run every 5 minutes
    },
  • change the time of account creation in profiles/tasks.py to maybe 1 minutes to test locally
 three_days_ago = now() - timedelta(minutes=1)
  • Create users and do not activate them, check that the clean_non_activated_users task runs and deletes the non-activated users

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

@ihsaan-ullah ihsaan-ullah linked an issue Jun 18, 2025 that may be closed by this pull request
@Didayolo Didayolo self-assigned this Jun 19, 2025
@Didayolo
Copy link
Member

TODO: add a check that the account has no competitions and no submissions. This is a safety measure to avoid, for instance, deleting useful accounts that got marked as inactive.

@Didayolo Didayolo merged commit d237a83 into develop Jun 26, 2025
1 check passed
@Didayolo Didayolo deleted the delete_inactive_users branch June 26, 2025 19:26
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.

Delete non activated users

3 participants