-
-
Notifications
You must be signed in to change notification settings - Fork 53
fix: delete_user returns Exception event if response is Ok (Sourcery refactored) #69
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ def __init__( | |
| self.url = url | ||
| self.headers = headers | ||
| self.cookie_options = cookie_options | ||
| self.http_client = http_client if http_client else AsyncClient() | ||
| self.http_client = http_client or AsyncClient() | ||
|
|
||
| async def __aenter__(self) -> AsyncGoTrueAPI: | ||
| return self | ||
|
|
@@ -238,10 +238,9 @@ async def sign_in_with_phone( | |
| error : APIError | ||
| If an error occurs | ||
| """ | ||
| headers = self.headers | ||
| query_string = "?grant_type=password" | ||
| data = {"phone": phone, "password": password} | ||
| url = f"{self.url}/token{query_string}" | ||
|
Comment on lines
241
to
-244
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| url = f'{self.url}/token?grant_type=password' | ||
| headers = self.headers | ||
| response = await self.http_client.post(url, json=data, headers=headers) | ||
| return Session.parse_response(response) | ||
|
|
||
|
|
@@ -575,10 +574,9 @@ async def refresh_access_token(self, *, refresh_token: str) -> Session: | |
| error : APIError | ||
| If an error occurs | ||
| """ | ||
| headers = self.headers | ||
| query_string = "?grant_type=refresh_token" | ||
| data = {"refresh_token": refresh_token} | ||
| url = f"{self.url}/token{query_string}" | ||
|
Comment on lines
577
to
-581
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| url = f'{self.url}/token?grant_type=refresh_token' | ||
| headers = self.headers | ||
| response = await self.http_client.post(url, json=data, headers=headers) | ||
| return Session.parse_response(response) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ def __init__( | |
| self.url = url | ||
| self.headers = headers | ||
| self.cookie_options = cookie_options | ||
| self.http_client = http_client if http_client else SyncClient() | ||
| self.http_client = http_client or SyncClient() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| def __enter__(self) -> SyncGoTrueAPI: | ||
| return self | ||
|
|
@@ -238,10 +238,9 @@ def sign_in_with_phone( | |
| error : APIError | ||
| If an error occurs | ||
| """ | ||
| headers = self.headers | ||
| query_string = "?grant_type=password" | ||
| data = {"phone": phone, "password": password} | ||
| url = f"{self.url}/token{query_string}" | ||
|
Comment on lines
241
to
-244
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| url = f'{self.url}/token?grant_type=password' | ||
| headers = self.headers | ||
| response = self.http_client.post(url, json=data, headers=headers) | ||
| return Session.parse_response(response) | ||
|
|
||
|
|
@@ -575,10 +574,9 @@ def refresh_access_token(self, *, refresh_token: str) -> Session: | |
| error : APIError | ||
| If an error occurs | ||
| """ | ||
| headers = self.headers | ||
| query_string = "?grant_type=refresh_token" | ||
| data = {"refresh_token": refresh_token} | ||
| url = f"{self.url}/token{query_string}" | ||
|
Comment on lines
577
to
-581
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| url = f'{self.url}/token?grant_type=refresh_token' | ||
| headers = self.headers | ||
| response = self.http_client.post(url, json=data, headers=headers) | ||
| return Session.parse_response(response) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
AsyncGoTrueAPI.__init__refactored with the following changes:or-if-exp-identity)