Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: filter_events calling pi_get leads to error #15

Open
Rom1an opened this issue Dec 5, 2024 · 1 comment
Open

BUG: filter_events calling pi_get leads to error #15

Rom1an opened this issue Dec 5, 2024 · 1 comment

Comments

@Rom1an
Copy link

Rom1an commented Dec 5, 2024

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'
@Rom1an
Copy link
Author

Rom1an commented Dec 5, 2024

PR #13 seems to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant