Update pr_agent/git_providers/bitbucket_server_provider.py

Co-authored-by: qodo-merge-for-open-source[bot] <189517486+qodo-merge-for-open-source[bot]@users.noreply.github.com>
This commit is contained in:
Boston008 2025-08-11 09:47:16 +08:00 committed by GitHub
parent 34b562db22
commit bcfd2b3d6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,9 +41,9 @@ class BitbucketServerProvider(GitProvider):
# Get username and password from settings # Get username and password from settings
self.username = get_settings().get("BITBUCKET_SERVER.USERNAME", None) self.username = get_settings().get("BITBUCKET_SERVER.USERNAME", None)
self.password = get_settings().get("BITBUCKET_SERVER.PASSWORD", None) self.password = get_settings().get("BITBUCKET_SERVER.PASSWORD", None)
self.bitbucket_server_url = self._parse_bitbucket_server(url=pr_url)
if not self.bitbucket_server_url: if not self.bitbucket_server_url:
raise ValueError("Invalid or missing Bitbucket Server URL parsed from PR URL.") raise ValueError("Invalid or missing Bitbucket Server URL parsed from PR URL.")
self.bitbucket_server_url = self._parse_bitbucket_server(url=pr_url)
# If bearer token is provided, use it to authenticate, otherwise use username and password # If bearer token is provided, use it to authenticate, otherwise use username and password
try: try:
if self.bearer_token: if self.bearer_token: