python-pipedrive
python-pipedrive copied to clipboard
Deleting organization is not working.
pipedrive.Pipedrive(token).organizations({"id": org_id}, method='DELETE')
yields an error:
Please provide at least one item to delete
Looks it's because id is not handled properly in 'delete' requests. There are issued with bulk deletes as well (None of sent ids are deleted) adding
elif method == 'DELETE':
if 'id' in data:
putid = data.pop('id')
uri = '{0}{1}/{2}?api_token={3}'.format(PIPEDRIVE_API_URL, endpoint, str(putid), str(self.api_token))
response, data = self.http.request(uri, method=method, body=urlencode(data),
headers={'Content-Type': 'application/x-www-form-urlencoded'})
to Pipedrive._request makes it work