Skip to content

Deleting organization is not working. #17

Description

@ishsonya
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions