From 7bfbbaf84e659596ddb7fff46946bcadb9a59c2c Mon Sep 17 00:00:00 2001 From: Antonio Golfari Date: Wed, 5 Jun 2024 00:28:41 +0200 Subject: [PATCH] added STOPPED / NOT VALID case --- airscore/public/views.py | 3 ++- airscore/templates/public/comp.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/airscore/public/views.py b/airscore/public/views.py index 181dfb07..23163115 100644 --- a/airscore/public/views.py +++ b/airscore/public/views.py @@ -392,7 +392,8 @@ def competition(compid: int): '''tracks download status''' task['tracks_status'] = frontendUtils.task_has_valid_results(task['id']) if task['cancelled']: - task['status'] = "CANCELLED" + # it could be cancelled or stopped but not valid + task['status'] = "CANCELLED" if not task['stopped_time'] else "STOPPED / NOT VALID" all_tasks.append(task) all_tasks.sort(key=lambda k: k['date'], reverse=True) diff --git a/airscore/templates/public/comp.html b/airscore/templates/public/comp.html index db5cf263..cab2125c 100644 --- a/airscore/templates/public/comp.html +++ b/airscore/templates/public/comp.html @@ -50,7 +50,7 @@

No task has been set yet

{{ task.task_name }}

{{ task.date }} {% if task.training %}(TRAINING DAY){% endif %}
- {% if task.status == 'CANCELLED' %} + {% if task.status in ['CANCELLED', 'STOPPED / NOT VALID'] %} {% set class = 'text-danger' %} {% elif task.status is in ['Not yet scored', 'Task not set'] %} {% set class = 'text-warning' %}