From 1f4cb5700ef1863e60db7efb132f83a0fd82e2d1 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 2 Aug 2022 09:48:11 +0200 Subject: [PATCH] group: "group_name" --- app/models/groups.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/models/groups.py b/app/models/groups.py index 7c87d442..8b890a6a 100644 --- a/app/models/groups.py +++ b/app/models/groups.py @@ -129,12 +129,8 @@ class GroupDescr(db.Model): def to_dict(self, with_partition=True) -> dict: """as a dict, with or without partition""" - d = { - "id": self.id, - "partition_id": self.partition_id, - "name": self.group_name, - "numero": self.numero, - } + d = dict(self.__dict__) + d.pop("_sa_instance_state", None) if with_partition: d["partition"] = self.partition.to_dict(with_groups=False) return d