FAI-CIVL / FAI-Airscore

AirScore - online paragliding / hanggliding GAP-based scoring software.
https://airscore.cc/
GNU General Public License v3.0
14 stars 18 forks source link

Bug when publishing rankings based on a custom attribute #288

Open joergewald opened 3 years ago

joergewald commented 3 years ago
  1. Imported an FSDB file which defines a custom attribute "SportClass" for every pilot
  2. Added a ranking "Sports Class", based on custom attribute "SportClass"=1
  3. Checking tracks and scoring worked fine.
  4. Published the results.
  5. Calling up the results HTML gave this error:

[2021-05-29 13:06:07,923] ERROR in app: Exception on /task_result/9 [GET] Traceback (most recent call last): File "/home/sid/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/home/sid/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/sid/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/sid/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/sid/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/home/sid/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/app/airscore/public/views.py", line 510, in task_result result_file = frontendUtils.get_pretty_data(file) File "/app/airscore/core/frontendUtils.py", line 1452, in get_pretty_data and r['custom'][str(s['attr_id'])] == s['rank_value']) KeyError: '3'

  1. Removed the "Sports Class" ranking
  2. Re-scored, re-published the results
  3. Now calling up the results HTML worked fine

It would seem that producing the results HTML for rankings based on custom attributes is broken.