atlassian-api / atlassian-python-api

Atlassian Python REST API wrapper
https://atlassian-python-api.readthedocs.io
Apache License 2.0
1.29k stars 643 forks source link

user_get_websudo is throwing throwing 'Expecting value: line 10 column 1 (char 9)' #1267

Closed amad1101 closed 7 months ago

amad1101 commented 8 months ago

The user_get_websudo method is throwing an 'Expecting value: line 10 column 1 (char 9)' exception because of the lack of not_json_response parameter not being passed in the user_get_websudo method.

amad1101 commented 8 months ago

In the jira.py, we need to update the call to answer = self.get("secure/admin/WebSudoAuthenticate.jspa", self.form_token_headers, not_json_response=True)

amad1101 commented 8 months ago

I also had to decode the response as it comes in bytes


        decoded_answer = answer.decode()
        atl_token = None
        if answer:
            atl_token = (
                decoded_answer.split('<meta id="atlassian-token" name="atlassian-token" content="')[1]
                .split("\n")[0]
                .split('"')[0]
            )```
gonchik commented 8 months ago

@amad1101 please raise PR.

amad1101 commented 8 months ago

@gonchik - Created the following PR https://github.com/atlassian-api/atlassian-python-api/pull/1272