diff --git a/api/system/info.py b/api/system/info.py index 89eec38f..32729298 100644 --- a/api/system/info.py +++ b/api/system/info.py @@ -162,7 +162,7 @@ async def get_user_sites( # record matches the current site current_site_exists = True if user_name not in site.users: - current_site.users.extend(site.users) + current_site.users.update(site.users) current_needs_update = True # we can use elif here, because we only need to check one condition elif site.platform != current_site.platform: diff --git a/api/system/sites.py b/api/system/sites.py index e4d37c29..7b23a4e7 100644 --- a/api/system/sites.py +++ b/api/system/sites.py @@ -12,7 +12,7 @@ class SiteInfo(OPModel): platform: Platform = Field(...) hostname: str = Field(..., title="Machine hostname") version: str = Field(..., title="Ayon version") - users: list[str] = Field(..., title="List of users") + users: set[str] = Field(..., title="List of users") @router.get("/system/sites", tags=["System"]) diff --git a/ayon_server/utils.py b/ayon_server/utils.py index ad312d3d..104b47a1 100644 --- a/ayon_server/utils.py +++ b/ayon_server/utils.py @@ -49,6 +49,9 @@ def json_default_handler(value: Any) -> Any: if isinstance(value, datetime.datetime): return value.isoformat() + if isinstance(value, set): + return list(value) + raise TypeError(f"Type {type(value)} is not JSON serializable")