From bbb74b7b904cfe27307616d072a42b113301b8e6 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 14 May 2020 14:47:32 -0400 Subject: [PATCH] Remove nio <0.11 asdict workaround Mirage 0.5.0 requires nio 0.11+ --- src/backend/models/items.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/backend/models/items.py b/src/backend/models/items.py index ce33a9c3..6bd16c62 100644 --- a/src/backend/models/items.py +++ b/src/backend/models/items.py @@ -266,12 +266,7 @@ class Event(ModelItem): def serialize_field(self, field: str) -> Any: if field == "source": - try: - as_dict = nio.attr.asdict # nio < 0.11 - except AttributeError: - as_dict = asdict - - source_dict = as_dict(self.source) if self.source else {} + source_dict = asdict(self.source) if self.source else {} return json.dumps(source_dict) return super().serialize_field(field)