FAI-CIVL / FAI-Airscore

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

broken FSDB import #210

Closed kuaka closed 3 years ago

kuaka commented 3 years ago

commit 0bda753d03b83cb26230092c6ff7cb523087c33b breaks import of forbes 2018

airscore_prod | File "/app/airscore/user/views.py", line 185, in _import_comp_fsdb airscore_prod | f = FSDB.read(fsdb_file) airscore_prod | File "/app/airscore/core/fsdb.py", line 70, in read airscore_prod | comp.formula = Formula.from_fsdb(fs_comp) airscore_prod | File "/app/airscore/core/formula.py", line 297, in from_fsdb airscore_prod | formula = get_fsdb_info(Formula(), fs_info.find('FsScoreFormula')) airscore_prod | File "/app/airscore/core/formula.py", line 481, in get_fsdb_info airscore_prod | 0 + get_int(form.get('min_time_span_for_valid_task')) * 60 airscore_prod | TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

please test any fix against this fsdb file. Better still would be a unit test.

biuti commented 3 years ago

I test that file among others, I tested now and had no errors. The file has min_time_span_for_valid_task="60" Is the one you are testing like this in FsScoreFormula? That value cannot be null as far as I know.

kuaka commented 3 years ago

my mistake sorry. I was choosing the wrong file in the folder. I was trying to import forbes2018.trim-fsdb.xml and not forbes2018.clean-fsdb.xml. I am not sure what the trim is. Tested with the correct file and it works.

philderbeast commented 3 years ago

I am not sure what the trim is.

@kuaka, the trimmed file is the XML stripped of elements and attributes not used by flare-timing.