Skip to content

Commit

Permalink
Fix timezone compare error on osmenrich
Browse files Browse the repository at this point in the history
  • Loading branch information
meomancer committed Oct 20, 2023
1 parent d2040fc commit 369b0ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker-osmenrich/enrich.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from sys import exit, stderr
from time import sleep
from urllib import request
from datetime import timezone

import xmltodict
import yaml
Expand Down Expand Up @@ -319,7 +320,7 @@ def get_osm_enrich_new_data(self, from_osm, from_database):
if osm_id and row:
allow_updated = False
osm_timestamp = self.check_data_on_dict(from_osm, '@timestamp')
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=None)
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=timezone.utc)
if not row['changeset_timestamp'] or row['changeset_timestamp'] < osm_datetime:
allow_updated = True
if allow_updated:
Expand Down

0 comments on commit 369b0ae

Please sign in to comment.