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 12, 2024
1 parent 6abd2cd commit a35746f
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 @@ -186,7 +186,9 @@ def api_base_url(self):

@api_base_url.setter
def api_base_url(self, value):
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 @@ -229,7 +231,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 a35746f

Please sign in to comment.