Skip to content

Commit 84702bb

Browse files
fix: deleting all participant along all teams (#815)
### Description When deleting all teams, participants must be deleted as well ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] All tests passing - [ ] Extended the documentation, if necessary
1 parent 553436a commit 84702bb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

app/modules/raid/cruds_raid.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ async def delete_participant(
192192
await db.flush()
193193

194194

195+
async def delete_all_participant(
196+
db: AsyncSession,
197+
) -> None:
198+
await db.execute(delete(models_raid.Participant))
199+
await db.flush()
200+
201+
195202
async def delete_team_invite_tokens(
196203
team_id: str,
197204
db: AsyncSession,

app/modules/raid/endpoints_raid.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ async def delete_all_teams(
464464
# Delete all teams from the database
465465
await cruds_raid.delete_all_teams(db)
466466

467+
# Delete all participants from the database
468+
await cruds_raid.delete_all_participant(db)
469+
467470
delete_all_folder_from_data("raid")
468471

469472

0 commit comments

Comments
 (0)