diff --git a/ogn/commands/bulkimport.py b/ogn/commands/bulkimport.py index 80e77d3..9d5c2ae 100644 --- a/ogn/commands/bulkimport.py +++ b/ogn/commands/bulkimport.py @@ -36,7 +36,7 @@ def convert(sourcefile, path=''): match = re.search('^.+\.txt\_(\d{4}\-\d{2}\-\d{2})(\.gz)?$', sourcefile) if match: reference_date_string = match.group(1) - reference_date = datetime.strptime(reference_date_string, "%Y-%m-%d") + reference_date = datetime.datetime.strptime(reference_date_string, "%Y-%m-%d") else: print("filename '{}' does not match pattern. Skipping".format(sourcefile)) return diff --git a/ogn/model/aircraft_beacon.py b/ogn/model/aircraft_beacon.py index a389f38..f0eea61 100644 --- a/ogn/model/aircraft_beacon.py +++ b/ogn/model/aircraft_beacon.py @@ -94,7 +94,7 @@ class AircraftBeacon(Beacon): def get_csv_values(self): return [ self.location_wkt, - int(self.altitude), + int(self.altitude) if self.altitude else None, self.name, self.receiver_name, self.timestamp,