Skip to content

Commit

Permalink
fix: Simplify nested f-string to fix pydoc-markdown parsing (#6717)
Browse files Browse the repository at this point in the history
  • Loading branch information
malhotra5 authored Feb 14, 2025
1 parent f5fccab commit edd5110
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions openhands/resolver/interfaces/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def get_headers(self):
}

def get_base_url(self):
return f'https://gitlab.com/api/v4/projects/{quote(f'{self.owner}/{self.repo}', safe="")}'
project_path = quote(f'{self.owner}/{self.repo}', safe="")
return f'https://gitlab.com/api/v4/projects/{project_path}'

def get_authorize_url(self):
return f'https://{self.username}:{self.token}@gitlab.com/'
Expand All @@ -45,9 +46,9 @@ def get_download_url(self):
return f'{self.base_url}/issues'

def get_clone_url(self):
username_and_token = (
f'{self.username}:{self.token}' if self.username else f'{self.token}'
)
username_and_token = self.token
if self.username:
username_and_token = f'{self.username}:{self.token}'
return f'https://{username_and_token}@gitlab.com/{self.owner}/{self.repo}.git'

def get_graphql_url(self):
Expand Down Expand Up @@ -360,7 +361,8 @@ def download_pr_metadata(
}
"""

variables = {'projectPath': f'{self.owner}/{self.repo}', 'pr': f'{pull_number}'}
project_path = f'{self.owner}/{self.repo}'
variables = {'projectPath': project_path, 'pr': str(pull_number)}

response = requests.post(
self.get_graphql_url(),
Expand Down

0 comments on commit edd5110

Please sign in to comment.