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

Multiple portfolio flags bug: no check when editing an existing portfolio #2859

Closed
zandercymatics opened this issue Sep 27, 2024 · 0 comments · Fixed by #2917
Closed

Multiple portfolio flags bug: no check when editing an existing portfolio #2859

zandercymatics opened this issue Sep 27, 2024 · 0 comments · Fixed by #2917
Assignees
Labels
bug Something that isn't working as intended dev

Comments

@zandercymatics
Copy link
Contributor

zandercymatics commented Sep 27, 2024

Current Behavior

Currently, you cannot add more than one userportfoliopermission per user when the "multiple_portfolios" waffle flag is off - which is expected. However, if you take an existing userportfoliopermission record and add the same user that way, the form lets you do this.

Expected Behavior

The multiple_portfolios waffle flag is intended to only allow one UserPortfolioPermission record per user.
The current check we have on new records should remain, but we should also deny the user from associating themselves with multiple portfolios by just editing another unrelated UserPortfolioPermission record.

Steps to Reproduce

  1. Create two different UserPortfolioPermission records (with different portfolios and users)
  2. On one of the records, set yourself as the user.
  3. On the record that isn't set as your user, edit it.
  4. Add yourself as the user to that record.
  5. Note that now, technically, you are assigned multiple portfolios

Environment

No response

Additional Context

We're currently doing a form-level check for this, and that should be sufficient for this ticket as well.

Note: this may be related to the self.pk check in user_portfolio_permission.py.
image

Issue Links

@zandercymatics zandercymatics added the bug Something that isn't working as intended label Sep 27, 2024
@abroddrick abroddrick moved this from 👶 New to 🎯 Ready in .gov Product Board Sep 30, 2024
@PaulKuykendall PaulKuykendall moved this from 🎯 Ready to 🔖 Planned in .gov Product Board Oct 2, 2024
@CocoByte CocoByte self-assigned this Oct 2, 2024
CocoByte added a commit that referenced this issue Oct 18, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in .gov Product Board Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working as intended dev
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants