Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

Merge ghost users with same email in different case #224

Open
athyuttamre opened this issue Jan 14, 2018 · 0 comments
Open

Merge ghost users with same email in different case #224

athyuttamre opened this issue Jan 14, 2018 · 0 comments
Labels

Comments

@athyuttamre
Copy link
Member

We have many ghost accounts (created either via the "Add TA" form, or via the multiple-student tickets form) with the same email IDs, but in different cases e.g. 'john_doe@brown.edu', and 'John_Doe@brown.edu'.

To fix this issue, we need to do the following:

  • Lowercase, trim, and validate emails before creating accounts via these two places
  • Write a migration that does the following:
    • Create a map of all sanitized emails with multiple user IDs associated with them
      { 'john_doe@brown.edu': [userId1, userId2, etc.]
      
    • For each such group, pick one user ID as the canonical one. Update the document to have the sanitized email.
    • Iterate through queues, and update all user ID fields to map from the other users to the picked user
    • Iterate through tickets, and update all user ID fields like above (including fields like userIds, createdBy etc.)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant