Skip to content

Commit 3ba9a12

Browse files
Copilot1ukastesar
andcommitted
Fix diplom command to handle accented names from VUT API
Previously, the command only removed accents from user input but not from the database name, causing comparison failures for users with accents in their names. Now both names have accents removed before comparison. Co-authored-by: 1ukastesar <16971100+1ukastesar@users.noreply.github.com>
1 parent d7c48dd commit 3ba9a12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cogs/absolvent/cog.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ def remove_accents(input_str):
9393
await inter.edit_original_response(MessagesCZ.not_in_db)
9494
return
9595

96-
name_from_db = name_from_db.name
97-
if name_from_db != name_from_user_without_diacritics:
96+
# remove diacritics from both names for comparison since VUT API now returns names with accents
97+
name_from_db_without_diacritics = remove_accents(name_from_db.name)
98+
if name_from_db_without_diacritics != name_from_user_without_diacritics:
9899
await inter.edit_original_response(MessagesCZ.wrong_name)
99100
return
100101

0 commit comments

Comments
 (0)