Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow participants w/ empty name #502

Open
ThiefMaster opened this issue Jan 17, 2025 · 1 comment
Open

Do not allow participants w/ empty name #502

ThiefMaster opened this issue Jan 17, 2025 · 1 comment
Assignees

Comments

@ThiefMaster
Copy link
Member

Not sure how it happened in the first place and I'm pretty sure we reject it AT LEAST on the frontend, but if you end up with such a participant in the DB, it fails when trying to generate the avatar url:

File "/usr/local/lib/python3.12/site-packages/newdle/schemas.py", line 130, in <lambda>
'api.user_avatar', payload=avatar_payload_from_participant(participant)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/newdle/core/util.py", line 123, in avatar_payload_from_participant
'initial': participant.name[0].upper(),
~~~~~~~~~~~~~~~~^^^
IndexError: string index out of range
@renefs
Copy link
Contributor

renefs commented Jan 20, 2025

I can take a look if you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants