Fix race frontend issue with no users
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 21s

This commit is contained in:
2024-02-26 16:28:08 +01:00
parent 3d27099bbb
commit 594653e3bf
2 changed files with 41 additions and 33 deletions

View File

@ -9,7 +9,7 @@ app.url_map.strict_slashes = False
db: SQLAlchemy = SQLAlchemy()
db.init_app(app)
# NOTE: These imports are required to register the routes. They need to be after "app" is declared
# NOTE: These imports are required to register the routes. They need to be imported after "app" is declared
import formula10.controller.race_controller # type: ignore
import formula10.controller.season_controller # type: ignore
import formula10.controller.admin_controller # type: ignore

View File

@ -52,6 +52,7 @@
<small><span class="fw-bold">Guess:</span> P{{ model.current_race.place_to_guess }}</small>
</td>
{% if model.all_users() | length > 0 %}
{% for user in model.all_users() %}
{% set user_guess = model.race_guesses_by(user_name=user.name, race_name=model.current_race.name) %}
@ -70,6 +71,9 @@
{% endif %}
</td>
{% endfor %}
{% else %}
<td>&nbsp;</td>
{% endif %}
<td>&nbsp;</td>
</tr>
@ -116,6 +120,7 @@
<small><span class="fw-bold">Guessed:</span> P{{ past_result.race.place_to_guess }}</small>
</td>
{% if model.all_users_or_active_user() | length > 0 %}
{% for user in model.all_users_or_active_user() %}
<td class="text-center text-nowrap">
{% set user_guess = model.race_guesses_by(user_name=user.name, race_name=past_result.race.name) %}
@ -140,6 +145,9 @@
{% endif %}
</td>
{% endfor %}
{% else %}
<td>&nbsp;</td>
{% endif %}
{# Actual result #}
<td class="text-center text-nowrap">