From 59dbc15be7c304af97db16d14a043aa4354df0e2 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 30 Sep 2020 11:39:25 +0200 Subject: [PATCH] core: make group_attributes include user's attributes --- passbook/core/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/passbook/core/models.py b/passbook/core/models.py index 9347183fa..e910ef43d 100644 --- a/passbook/core/models.py +++ b/passbook/core/models.py @@ -82,10 +82,12 @@ class User(GuardianUserMixin, AbstractUser): objects = UserManager() def group_attributes(self) -> Dict[str, Any]: - """Get a dictionary containing the attributes from all groups the user belongs to""" + """Get a dictionary containing the attributes from all groups the user belongs to, + including the users attributes""" final_attributes = {} for group in self.pb_groups.all().order_by("name"): final_attributes.update(group.attributes) + final_attributes.update(self.attributes) return final_attributes @cached_property