From 608a930f0f41bfba9e202e3f31157a1c6e2aa923 Mon Sep 17 00:00:00 2001 From: Rick Hermans Date: Sat, 29 May 2021 01:24:14 +0200 Subject: [PATCH] Fix append in getAllMembers function --- group.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/group.py b/group.py index 3c121cc..97c641b 100644 --- a/group.py +++ b/group.py @@ -23,19 +23,22 @@ class Group: else: self.members.append(admidio.getMemberFromID(row[0])) except MemberNotFoundException: - print( - f"Member with id {row[0]} not found, group id: {self.id}") + print(f"Member with id {row[0]} not found, group id: {self.id}") def __eq__(self, other): if isinstance(other, Group): return self.hash() == other.hash() def hash(self): - return hashlib.md5((str(self.id) + self.name - + (''.join(str(x) for x in self.members) or '') - + (''.join(str(x) for x in self.leaders) or '') - ).encode('utf-8')).hexdigest() + return hashlib.md5( + ( + str(self.id) + + self.name + + ("".join(str(x) for x in self.members) or "") + + ("".join(str(x) for x in self.leaders) or "") + ).encode("utf-8") + ).hexdigest() def getAllMembers(self): """Return leaders and members in group, combined""" - return self.leaders.append(self.members) + return self.leaders + self.members