@@ -38,9 +38,9 @@ def delete_organization(object_id, transaction_id=None, continuous=True, **kwarg
3838 o .update (status = OrganizationStatus .DELETION_IN_PROGRESS )
3939 pending_delete .send (sender = Organization , instance = o )
4040
41- for team in Team .objects .filter (organization = o ).exclude ( status = TeamStatus . DELETION_IN_PROGRESS ). order_by ('id' )[:1 ]:
41+ for team in Team .objects .filter (organization = o ).order_by ('id' )[:1 ]:
4242 team .update (status = TeamStatus .DELETION_IN_PROGRESS )
43- delete_team (team .id , transaction_id = transaction_id )
43+ delete_team (team .id , transaction_id = transaction_id , continuous = False )
4444 if continuous :
4545 delete_organization .apply_async (
4646 kwargs = {'object_id' : object_id , 'transaction_id' : transaction_id },
@@ -86,9 +86,9 @@ def delete_team(object_id, transaction_id=None, continuous=True, **kwargs):
8686 t .update (status = TeamStatus .DELETION_IN_PROGRESS )
8787
8888 # Delete 1 project at a time since this is expensive by itself
89- for project in Project .objects .filter (team = t ).exclude ( status = ProjectStatus . DELETION_IN_PROGRESS ). order_by ('id' )[:1 ]:
89+ for project in Project .objects .filter (team = t ).order_by ('id' )[:1 ]:
9090 project .update (status = ProjectStatus .DELETION_IN_PROGRESS )
91- delete_project (project .id , transaction_id = transaction_id )
91+ delete_project (project .id , transaction_id = transaction_id , continuous = False )
9292 if continuous :
9393 delete_team .apply_async (
9494 kwargs = {'object_id' : object_id , 'transaction_id' : transaction_id },
0 commit comments