From 738217d979ee0436f50d8b1c1e5e5d28ca2d1a4e Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 9 Aug 2022 15:52:48 +0200 Subject: [PATCH] feat(chalice): fixed try payload validation for old data --- api/schemas.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/schemas.py b/api/schemas.py index 314a0f7d2..fdea7f439 100644 --- a/api/schemas.py +++ b/api/schemas.py @@ -560,6 +560,8 @@ class _SessionSearchEventRaw(__MixedSearchFilter): assert len(values["source"]) > 0 and isinstance(values["source"][0], int), \ f"source of type int if required for {PerformanceEventType.time_between_events}" else: + assert "source" in values, f"source is required for {values.get('type')}" + assert isinstance(values["source"], list), f"source of type list is required for {values.get('type')}" for c in values["source"]: assert isinstance(c, int), f"source value should be of type int for {values.get('type')}" elif values.get("type") == EventType.error and values.get("source") is None: