Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/FAI-CIVL/FAI-Airscore
Browse files Browse the repository at this point in the history
…into development
  • Loading branch information
biuti committed Jul 24, 2024
2 parents f024100 + d051ddb commit 697f7ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions airscore/core/frontendUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,8 +1327,10 @@ def get_comp_info(compid: int, task_ids=None):

with db_session() as db:
non_scored_tasks = (
db.query(t.task_id.label('id'),
t.task_name, t.date, t.task_type, t.opt_dist, t.training, t.comment, t.cancelled)
db.query(
t.task_id.label('id'),
t.task_name, t.date, t.task_type, t.opt_dist,
t.training, t.comment, t.stopped_time, t.cancelled)
.filter_by(comp_id=compid)
.order_by(t.date.desc())
.all()
Expand Down
3 changes: 2 additions & 1 deletion airscore/public/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions airscore/templates/public/comp.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1> No task has been set yet</h1>
<div class='col'>
<h3 id='task_hd'>{{ task.task_name }}</h3>
<h5>{{ task.date }} {% if task.training %}<span class = 'text-info'>(TRAINING DAY)</span>{% endif %}</h5>
{% 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' %}
Expand Down Expand Up @@ -94,7 +94,7 @@ <h6>{{ task.comment }}</h6>
<a href="{{ url_for('public.tracks', taskid=task.id) }}" class='btn btn-primary'>Tracks Status</a>
</p>
{% endif %}
{% elif task.status is not in ["Task not set", "CANCELLED"] %}
{% elif task.status is not in ['Task not set', 'CANCELLED', 'STOPPED / NOT VALID'] %}
<p>
<a href="{{ url_for('public.download_file', filetype='igc_zip', filename=task.id) }}">IGC Zip File</a>
</p>
Expand Down

0 comments on commit 697f7ab

Please sign in to comment.