Add logic to fetch single Harvest time entry via API

for one-off imports
This commit is contained in:
Lance Edgar 2023-10-05 09:50:12 -05:00
parent aa87ce57be
commit fe0daf00bc

View file

@ -79,6 +79,12 @@ class TimeEntryImporter(ToHarvest):
cache[key] = normal
return cache
def get_single_local_object(self, key):
assert len(self.key) == 1 and self.key[0] == 'id'
entry_id = key[0]
if entry_id > 0:
return self.webapi.get_time_entry(entry_id)
def normalize_local_object(self, entry):
data = {
'id': entry['id'],