Skip to content

Commit

Permalink
fix: handle setting api_base_url to its value
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Jul 18, 2024
1 parent 12577cf commit 1dc7ae5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addon_service/authorized_storage_account/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ def api_base_url(self) -> str:

@api_base_url.setter
def api_base_url(self, value: str):
self._api_base_url = value
self._api_base_url = (
"" if value == self.external_service.api_base_url else value
)

@property
def imp_cls(self) -> type[AddonImp]:
Expand Down Expand Up @@ -291,7 +293,7 @@ def validate_api_base_url(self):
"api_base_url": f"Cannot specify an api_base_url for Public-only service {service.display_name}"
}
)
if ServiceTypes.PUBLIC not in service.service_type and not self.api_base_url:
if ServiceTypes.PUBLIC not in service.service_type and not self._api_base_url:
raise ValidationError(
{
"api_base_url": f"Must specify an api_base_url for Hosted-only service {service.display_name}"
Expand Down

0 comments on commit 1dc7ae5

Please sign in to comment.