From e8f58a4fef89d5c75ccb9f5c7b9a0fb52a4f0206 Mon Sep 17 00:00:00 2001 From: RamuniN Date: Fri, 6 Oct 2023 12:07:01 +0100 Subject: [PATCH] fix staticmethod method --- external_services/models/round.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/external_services/models/round.py b/external_services/models/round.py index 47457542..31d637e3 100644 --- a/external_services/models/round.py +++ b/external_services/models/round.py @@ -11,10 +11,14 @@ class FeedbackSurveyConfig: is_section_feedback_optional: bool = True @staticmethod - def from_json(cls, d: dict): + def from_json(d: dict): # Filter unknown fields from JSON dictionary - return cls( - **{k: v for k, v in d.items() if k in inspect.signature(cls).parameters} + return FeedbackSurveyConfig( + **{ + k: v + for k, v in d.items() + if k in inspect.signature(FeedbackSurveyConfig).parameters + } )