Skip to content

BUG: filter_events calling pi_get leads to error #15

@Rom1an

Description

@Rom1an

The function filter_events calls pi_get with a query parameter in the URI:

def filter_events(self, filter_str: dict = None, cid: int = None) -> ApiResponse:
        [...]

        return self._s.pi_get(f'case/timeline/advanced-filter?q={filter_uri}&', cid=cid)

This however lead to an error since pi_get check if a CID is given, and if it is, it includes it in the query, adding a second question mark:

    def pi_get(self, uri: str, cid: int = None, no_wrap: bool = False) -> Union[ApiResponse, Response]:
        if cid:
            uri = f"{uri}?cid={cid}"
        [...]

This leads to incorrect URI such has the following (debug output of uri value):

-> return self._pi_request(uri, type='GET', no_wrap=no_wrap)
(Pdb) uri
'case/timeline/advanced-filter?q=%7B%7D&?cid=135'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions