Fix #1491
This commit is contained in:
parent
a74f0c2af0
commit
f405d04ce1
@ -116,13 +116,6 @@ class FlightImporter extends ImportExport
|
||||
$flight->setAttribute('flight_type', $flight_type);
|
||||
$flight->setAttribute('active', get_truth_state($row['active']));
|
||||
|
||||
try {
|
||||
$flight->save();
|
||||
} catch (\Exception $e) {
|
||||
$this->errorLog('Error in row '.$index.': '.$e->getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create/check that they exist
|
||||
$process_dep = $this->processAirport($row['dpt_airport']);
|
||||
if (is_null($process_dep)) {
|
||||
@ -142,6 +135,13 @@ class FlightImporter extends ImportExport
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$flight->save();
|
||||
} catch (\Exception $e) {
|
||||
$this->errorLog('Error in row '.$index.': '.$e->getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check/calculate the distance
|
||||
if (empty($row['distance'])) {
|
||||
$row['distance'] = $this->airportSvc->calculateDistance(
|
||||
|
Loading…
Reference in New Issue
Block a user