Ruff after aider
This commit is contained in:
parent
cd9e32e4b0
commit
04b3baaba2
|
@ -169,13 +169,13 @@ class GiteaClient:
|
||||||
# If a pull request for this head/base already exists, return it instead of crashing
|
# If a pull request for this head/base already exists, return it instead of crashing
|
||||||
if response.status_code == 422:
|
if response.status_code == 422:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Pull request already exists for head %s and base %s", head, base
|
'Pull request already exists for head %s and base %s', head, base,
|
||||||
)
|
)
|
||||||
prs = self.get_pull_requests(owner, repo)
|
prs = self.get_pull_requests(owner, repo)
|
||||||
for pr in prs:
|
for pr in prs:
|
||||||
if (
|
if (
|
||||||
pr.get("head", {}).get("ref") == head
|
pr.get('head', {}).get('ref') == head
|
||||||
and pr.get("base", {}).get("ref") == base
|
and pr.get('base', {}).get('ref') == base
|
||||||
):
|
):
|
||||||
return pr
|
return pr
|
||||||
# fallback to raise if we can’t find it
|
# fallback to raise if we can’t find it
|
||||||
|
@ -201,10 +201,10 @@ class GiteaClient:
|
||||||
self,
|
self,
|
||||||
owner: str,
|
owner: str,
|
||||||
repo: str,
|
repo: str,
|
||||||
state: str = "open",
|
state: str = 'open',
|
||||||
) -> list[dict]:
|
) -> list[dict]:
|
||||||
"""Fetch pull requests for a repository."""
|
"""Fetch pull requests for a repository."""
|
||||||
url = f"{self.gitea_url}/repos/{owner}/{repo}/pulls?state={state}"
|
url = f'{self.gitea_url}/repos/{owner}/{repo}/pulls?state={state}'
|
||||||
response = self.session.get(url)
|
response = self.session.get(url)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user