Add some support for datasync, and deleting times from Harvest

This commit is contained in:
Lance Edgar 2023-10-08 20:38:25 -05:00
parent fe0daf00bc
commit bdb8b22ef4
4 changed files with 35 additions and 53 deletions

View file

@ -31,7 +31,14 @@ from rattail_harvest.harvest.webapi import make_harvest_webapi
class ToHarvest(importing.Importer):
def setup(self):
super(ToHarvest, self).setup()
super().setup()
self.setup_webapi()
def datasync_setup(self):
super().datasync_setup()
self.setup_webapi()
def setup_webapi(self):
self.webapi = make_harvest_webapi(self.config)
@ -158,4 +165,5 @@ class TimeEntryImporter(ToHarvest):
if self.dry_run:
return True
raise NotImplementedError
self.webapi.delete_time_entry(entry['id'])
return True