Fix Flight Importer (#1202)

* Handle Route and Level fields too during import.
* Also removed the check for `visible => true` from `firstorNew` 'cause va admin may be importing to update not visible flights too.
  (by default all new flights are visible, so no affect on new flights)

Closes #1201
This commit is contained in:
B.Fatih KOZ 2021-05-24 22:19:06 +03:00 committed by GitHub
parent 7d8a34645e
commit 68a6ed24cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,6 @@ class FlightImporter extends ImportExport
'flight_number' => $row['flight_number'],
'route_code' => $row['route_code'],
'route_leg' => $row['route_leg'],
'visible' => true,
], $row);
$row['dpt_airport'] = strtoupper($row['dpt_airport']);
@ -99,6 +98,10 @@ class FlightImporter extends ImportExport
$flight->setAttribute('alt_airport_id', $row['alt_airport']);
}
// Handle Route and Level Fields
$flight->setAttribute('route', strtoupper($row['route']));
$flight->setAttribute('level', $row['level']);
// Any specific transformations
// Check for a valid value