Division by zero #12

Tancada
oberta 2020-12-05 16:18:41 +01:00 per spla · 1 comment
spla ha comentat 2020-12-05 16:18:41 +01:00 (Migrado desde gitlab.com)

If a user who never played query the bot to get the panel, the code throws this error:

Traceback (most recent call last):
File "mastochess.py", line 1572, in
create_panel(username, played_games, wins)
File "mastochess.py", line 35, in create_panel
ratio = round((wins * 100) / played_games, 2)
ZeroDivisionError: division by zero

If a user who never played query the bot to get the panel, the code throws this error: Traceback (most recent call last): File "mastochess.py", line 1572, in <module> create_panel(username, played_games, wins) File "mastochess.py", line 35, in create_panel ratio = round((wins * 100) / played_games, 2) ZeroDivisionError: division by zero
spla ha comentat 2020-12-05 16:19:19 +01:00 (Migrado desde gitlab.com)

changed the description

changed the description
Inicia sessió per a unir-te a aquesta conversa.
Sin etiquetas
bug
improve
Sense Milestone
Ningún proyecto
Sense assignats
1 participants
Notificacions
Data de venciment
La fecha de vencimiento es inválida o está fuera de rango. Por favor utilice el formato 'aaaa-mm-dd'.

Sin fecha de vencimiento.

Dependències

Aquesta incidència no té cap dependència.

Referència: spla/mastochess#12
Aún no existe contenido.