Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefile with airport ICAO not in database causes error when selecting PIREP #783

Closed
xterminator24 opened this issue Aug 12, 2020 · 7 comments · Fixed by #788
Closed

Prefile with airport ICAO not in database causes error when selecting PIREP #783

xterminator24 opened this issue Aug 12, 2020 · 7 comments · Fixed by #788
Labels
Milestone

Comments

@xterminator24
Copy link

Describe the bug
Our VA allows pilots to fly to destinations that may not yet be in the airports database. Completing a PREFILE through the /pipreps/prefile endpoint allows for this scenario as there is no checking that the departure and arrival airports exist in the database. The prefile shows up in the user's PIREPS list as "In Progress" as this shows https://imgur.com/Y10MUe9

However, if you click on the flight number in the PIREP list you get an Invalid argument exception error. "The error says Position elements must be integers or floats". I believe this is most likely due to the airport not having position coordinates in the airports table.

Version
7.0.0-beta4

To Reproduce
Steps to reproduce the behavior:

  1. Prefile through the API using the /pireps/prefile endpoint using an airport ICAO that doesn't exist in the airports table
  2. Visit the users PIREPS page by clicking on the option on the menu bar
  3. Click on the flight number in the PIREPS list
  4. https://imgur.com/ZZ4DeqE

Expected behavior
I would like to see the PIREP form still pull up but maybe without the line drawing on the map. The header that contains the airport info would also need to just display the ICAO for the airport that isn't in the database. I actually like the fact that you can fly to airports not yet in the database if you want as that increases possibilities for VA's. If VA's want to limit to only airports in the database, they could verify it's existence before allowing the prefile.

Screenshots
https://imgur.com/Y10MUe9
https://imgur.com/ZZ4DeqE

@nabeelio nabeelio added the bug label Aug 12, 2020
@nabeelio
Copy link
Owner

Thanks, it's actually supposed to add a placeholder airport with a 0,0 coordinate. I think I need to add a setting in order for it to try to do that (either as a lookup or just a default value). I probably missed that in a code path here.

@nabeelio
Copy link
Owner

Actually I noticed you're using the beta, can you try the latest dev? I might have changed that behavior there already.

@nabeelio nabeelio added this to the 7.0.0 milestone Aug 12, 2020
@nabeelio
Copy link
Owner

There is this setting, I think I need to expand it out to the prefile, etc

image

@nabeelio
Copy link
Owner

Ok, I think I need to add a new setting, "Allow unadded airports", an dthen look those up

@xterminator24
Copy link
Author

I tested the prefile with the latest DEV build (7.0.0-dev+200812.3ac03d) and encountered the same problem when the flight contains an airport not in the database. If you could automatically add an airport on the fly during a prefile, that would be amazing!

@nabeelio
Copy link
Owner

How do you handle flight numbers and stuff? Just a generic flight number?

@nabeelio
Copy link
Owner

Hey, can you try the above PR/branch to see if this is what you're looking for? There is a new setting that is off by default for "Allow unadded airports"

nabeelio added a commit that referenced this issue Aug 17, 2020
Allow any airport to be flown from #783
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants