flowfuse icon indicating copy to clipboard operation
flowfuse copied to clipboard

Allow users to delete accounts even when they have active teams

Open cstns opened this issue 1 year ago • 1 comments

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/helm to update ConfigMap Template
    • [ ] Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • [ ] Includes a DB migration? -> add the area:migration label

cstns avatar Aug 08 '24 13:08 cstns

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.

codecov[bot] avatar Aug 09 '24 12:08 codecov[bot]

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: image

Demo of issue:

chrome_2xXOaEqIhZ

Steve-Mcl avatar Aug 12 '24 09:08 Steve-Mcl

This change is orphaning teams/subscriptions. It does a team.destroy() without consideration of whether there is a subscription that needs cancelling.

knolleary avatar Sep 20 '24 16:09 knolleary