hacktoolkit / django-htk

A set of apps, utilities, middlewares, etc for Django
MIT License
140 stars 46 forks source link

Duplicate account slack alerts #388

Open goztrk opened 1 year ago

goztrk commented 1 year ago

Problem

accounts app has ability to have multiple e-mail addresses for UserModels. When there are multiple servers doing transactions there might be times that records get duplicated.

Solution

This cannot be fixed automatically because it might be really hard to determine which one to keep and which one to delete. Any wrong behavior will result with bad user experience.

As first step is to create a celery task that will search through user accounts and find duplicate email.

Flow

  1. Query all User records that have more than 1 UserEmail records.
  2. If there are records returned go to step 3. If there are no records go to step 4
  3. If there are records, alert them in #alerts-p2-danger listing out email addresses and user IDs. Goto step 5 a. It might be useful to also include a link for admin tools
  4. Alert in #alerts-p4-info that there are no problematic tools.
  5. End Task

Important variables to be determined

jontsai commented 1 year ago

I think this will be valuable to have, for sure.

Some thoughts:

Some principles: