Skip to content

Commit fc31169

Browse files
committed
fix: club creation when club already exists
1 parent 35bb39c commit fc31169

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/commands/club.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,7 @@ async def create_club(
122122
self, interaction: Interaction, club: Transform[ClubSchema, ClubTransformer]
123123
):
124124
await interaction.response.defer(thinking=True)
125-
try:
126-
await self.club_service.create_club(club, interaction.guild)
127-
await interaction.followup.send(f"Le club : {club.name} à été créé")
128-
except ClubExists:
125+
if Club.filter(Club.sith_id == club.id).exists():
129126
await interaction.followup.send(f"Le club : {club.name} existe déjà...")
130127
else:
131128
await self.club_service.create_club(club, interaction.guild)

0 commit comments

Comments
 (0)