Stop importing certain fields for HarvestUser cache table

since the Harvest API is suddenly no longer providing the values
This commit is contained in:
Lance Edgar 2022-11-14 17:43:26 -06:00
parent 782cb1fcec
commit e239ea70e4

View file

@ -114,6 +114,17 @@ class HarvestUserImporter(FromHarvest, rattail_harvest_importing.model.HarvestUs
data = super(HarvestUserImporter, self).normalize_host_object(user)
if data:
# TODO: for some reason the API used to include the these
# fields, but no longer does as of 2022-11-11, so null is
# kinda the only thing that makes sense now. if possible,
# should figure out "what changed" at Harvest, but maybe
# these fields should just be removed from our cache
# schema?
data.setdefault('is_admin', None)
data.setdefault('is_project_manager', None)
data.setdefault('can_see_rates', None)
data.setdefault('can_create_invoices', None)
if data['telephone'] == '':
data['telephone'] = None