Skip to content

Commit 6b62427

Browse files
committed
fixed flake8 issues
1 parent 3d6ceca commit 6b62427

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

examples/jira/jira_oauth2.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ def login():
5454
@app.route("/callback")
5555
def callback():
5656
jira_oauth = OAuth2Session(client_id, state=session["oauth_state"], redirect_uri=redirect_uri)
57-
request_url = request.url.replace("http://", "https://")
58-
token_json = jira_oauth.fetch_token(token_url, client_secret=client_secret, authorization_response=request_url)
57+
token_json = jira_oauth.fetch_token(token_url, client_secret=client_secret, authorization_response=request.url)
5958
return "Token: {}<p />Projects: {}".format(token_json, ", ".join(get_projects(token_json)))
6059

6160

@@ -67,7 +66,7 @@ def get_projects(token_json):
6766
req = requests.get(
6867
"https://api.atlassian.com/oauth/token/accessible-resources",
6968
headers={
70-
"Authorization": f"Bearer {token_json['access_token']}",
69+
"Authorization": "Bearer {}".format(token_json["access_token"]),
7170
"Accept": "application/json",
7271
},
7372
)
@@ -82,9 +81,5 @@ def get_projects(token_json):
8281
"token_type": "Bearer",
8382
},
8483
}
85-
jira = Jira(url=f"https://api.atlassian.com/ex/jira/{cloud_id}", oauth2=oauth2_dict)
84+
jira = Jira(url="https://api.atlassian.com/ex/jira/{}".format(cloud_id), oauth2=oauth2_dict)
8685
return [project["name"] for project in jira.projects()]
87-
88-
89-
if __name__ == "__main__":
90-
app.run(debug=True, port=8000, host="0.0.0.0")

0 commit comments

Comments
 (0)