Avoid entries w/ timer still running when exporting to Harvest

i.e. ignore entries on Harvest, which have timer running
This commit is contained in:
Lance Edgar 2022-02-17 07:39:29 -06:00
parent e79686b5b7
commit d8e9714771

View file

@ -60,9 +60,14 @@ class TimeEntryImporter(ToHarvest):
Fetch existing time entries from Harvest.
"""
cache = {}
# TODO: we try to avoid entries w/ timer still running here,
# but for some reason they still come back, so double-check
entries = self.webapi.get_time_entries(**{'from': self.start_date,
'to': self.end_date})
'to': self.end_date,
'is_running': False})
for entry in entries:
# double-check here
if not entry['is_running']:
data = self.normalize_local_object(entry)
if data:
normal = self.normalize_cache_object(entry, data)