Skip to content

Users.py function get_user_by_id() provides invalid parameters when calling get_user_by_url #293

@spdw

Description

@spdw

In Users.py the function get_user_by_url() only accepts a user_url:

def get_user_by_url(self, user_url):
    headers = {'Accept': 'application/vnd.blackducksoftware.user-4+json'}
    response = self.execute_get(user_url, custom_headers=headers)
    jsondata = response.json()
    return jsondata

The function get_user_by_id passes a second parameter custom_headers, which does not exist:

def get_user_by_id(self, user_id):
    url = self._get_user_url() + "/{}".format(user_id)
    headers = {'Accept': 'application/vnd.blackducksoftware.user-4+json'}
    return self.get_user_by_url(url, custom_headers=headers)

I guess the function should look like:

def get_user_by_id(self, user_id):
    url = self._get_user_url() + "/{}".format(user_id)
    return self.get_user_by_url(url)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions