Skip to content

[BUG]: Obsolete validation of email uniqueness makes it impossible to close certain account requests #5432

@scooter-dangle

Description

@scooter-dangle

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

As a super-admin, I'm unable to close account requests where the email is that of a user who was subsequently invited to a (different) org after they opened the request.

Expected Behavior

Account requests for emails with that condition can still be closed.

Steps To Reproduce

  1. I navigate as a super admin to the Account Requests page.
    In that tab, there is an account request that is no longer needed due to the user having been subsequently added as a user to a preëxisting org (the user was unaware that the org account already existed and that they just needed to be invited to join it).
  2. I click Close (Admin) for that request.
  3. I enter Has since been invited to pre-existing org (see email thread) in the Close Account Request modal for the Rejection reason.
  4. I click Save.
  5. I see that the request is still in the list and that a flash warning has appeared saying Validation failed: Email already used by an existing User
Image

Environment

Production

Criteria for Completion

  • Given an account request from an email that is registered as a user in another org account, the super-admin can still click Close (Admin), give a reason, and then see that the account request is now listed as a Closed Account Request
  • A test proving that this works

Anything else?

@dorner has said this is most likely due to a validation that's now obsolete. Previously, users could belong to exactly one org/account. When the app tries to modify the account request, a validation of this legacy requirement rejects the update since it finds that the email already maps to another org/account user.

Daniel suggests this bug might be solved just by removing that obsolete validation.

Code of Conduct

  • I've read the Code of Conduct and understand my responsibilities as a member of the Ruby for Good community

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions