Allow users to delete accounts even when they have active teams
Description
Allows users to delete their account if they have teams they are owner of. Users are still prevented from deleting their accounts if the owner team has members, instances or devices assigned to it.
Related Issue(s)
closes https://github.com/FlowFuse/flowfuse/issues/4292
Checklist
- [x] I have read the contribution guidelines
- [ ] Suitable unit/system level tests have been added and they pass
- [ ] Documentation has been updated
- [ ] Upgrade instructions
- [ ] Configuration details
- [ ] Concepts
- [ ] Changes
flowforge.yml?- [ ] Issue/PR raised on
FlowFuse/helmto update ConfigMap Template - [ ] Issue/PR raised on
FlowFuse/CloudProjectto update values for Staging/Production
- [ ] Issue/PR raised on
Labels
- [ ] Includes a DB migration? -> add the
area:migrationlabel
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 78.25%. Comparing base (
99ac40e) to head (ed4bddc).
Additional details and impacted files
@@ Coverage Diff @@
## main #4354 +/- ##
==========================================
+ Coverage 78.23% 78.25% +0.02%
==========================================
Files 292 292
Lines 13424 13439 +15
Branches 3010 3014 +4
==========================================
+ Hits 10502 10517 +15
Misses 2922 2922
| Flag | Coverage Δ | |
|---|---|---|
| backend | 78.25% <100.00%> (+0.02%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
NOTE: before I merge this, i need to check an issue I witnessed with creating users on this branch.
i was getting no feedback when creating a user. Clicking the "Create User" button again caused an "already exists" toast error.
I dont see how this PR would cause that issue but I need to do due diligence before merging,
Screenshot of issue:
Demo of issue:
This change is orphaning teams/subscriptions. It does a team.destroy() without consideration of whether there is a subscription that needs cancelling.