Fix UUID validation error.

pull/402/head
Andrey Dolgolev 2021-11-14 10:38:57 +02:00
rodzic 3ae3f9a390
commit 1aaa71e4ad
2 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -231,7 +231,7 @@ class OnboardingState(BaseModel):
class DashboardMeta(BaseModel):
subscription_id: str
subscription_id: UUID
generic: Optional[List[Dict[str, str]]]
all_methods: bool = False
all_events: bool = False

Wyświetl plik

@ -68,7 +68,7 @@ async def add_dashboard_handler(
s3_client = boto3.client("s3")
available_subscriptions = {
str(resource.id): resource.resource_data for resource in resources.resources
resource.id: resource.resource_data for resource in resources.resources
}
for dashboard_subscription in dashboard_subscriptions:
@ -130,10 +130,12 @@ async def add_dashboard_handler(
)
try:
# json.loads(dashboard_resource.json())
# Necessary because the UUIDs inside dashboard_resources do not get serialized into string if we directly convert to ".dict()"
resource: BugoutResource = bc.create_resource(
token=token,
application_id=MOONSTREAM_APPLICATION_ID,
resource_data=dashboard_resource.dict(),
resource_data=json.loads(dashboard_resource.json()),
)
except BugoutResponseException as e:
logger.error(f"Error creating dashboard resource: {str(e)}")