Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
fix staticmethod method
Browse files Browse the repository at this point in the history
  • Loading branch information
RamuniN committed Oct 6, 2023
1 parent a579eec commit e8f58a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions external_services/models/round.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)


Expand Down

0 comments on commit e8f58a4

Please sign in to comment.