Skip to content

Commit

Permalink
add apiBaseUrlOptions field
Browse files Browse the repository at this point in the history
  • Loading branch information
adlius committed Jan 8, 2025
1 parent 71a76c5 commit 94c2ac9
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions addon_service/external_service/citation/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ class Meta:
"external_service_name",
"supported_features",
"icon_url",
"api_base_url_options",
]
1 change: 1 addition & 0 deletions addon_service/external_service/computing/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ class Meta:
"supported_features",
"icon_url",
"wb_key",
"api_base_url_options",
]
1 change: 1 addition & 0 deletions addon_service/external_service/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ExternalService(AddonsServiceBaseModel):
)
supported_scopes = ArrayField(models.CharField(), null=True, blank=True)
api_base_url = models.URLField(blank=True, default="")
api_base_url_options = ArrayField(models.CharField(), null=True, blank=True)
wb_key = models.CharField(null=False, blank=True, default="")
oauth1_client_config = models.ForeignKey(
"addon_service.OAuth1ClientConfig",
Expand Down
4 changes: 4 additions & 0 deletions addon_service/external_service/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def get_icon_url(self, obj: ExternalService):
return None

external_service_name = serializers.CharField(read_only=True)
api_base_url_options = serializers.ListField(
child=serializers.CharField(), read_only=True
)

included_serializers = {
"addon_imp": "addon_service.serializers.AddonImpSerializer",
Expand All @@ -52,4 +55,5 @@ class Meta:
"wb_key",
"external_service_name",
"icon_url",
"api_base_url_options",
]
1 change: 1 addition & 0 deletions addon_service/external_service/storage/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ class Meta:
"configurable_api_root",
"supported_features",
"icon_url",
"api_base_url_options",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by Django 4.2.7 on 2025-01-08 05:22

import pathlib

import django.contrib.postgres.fields
from django.db import (
migrations,
models,
)


class Migration(migrations.Migration):

dependencies = [
("addon_service", "0009_externalservice_icon_name"),
]

operations = [
migrations.AddField(
model_name="externalservice",
name="api_base_url_options",
field=django.contrib.postgres.fields.ArrayField(
base_field=models.CharField(), blank=True, null=True, size=None
),
),
migrations.AlterField(
model_name="externalservice",
name="icon_name",
field=models.FilePathField(
blank=True,
match=".*\\.(jpg|png|svg)$",
null=True,
path=pathlib.PurePosixPath("/code/addon_service/static/provider_icons"),
),
),
]

0 comments on commit 94c2ac9

Please sign in to comment.