From d2ceefbe73110938e8b3b00cc2f037d366f0de6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20Ka=CC=88ser?= Date: Thu, 6 Aug 2015 17:54:35 +0200 Subject: [PATCH] always return lists; ensure no duplicates in get_managers --- ipynbsrv/core/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ipynbsrv/core/models.py b/ipynbsrv/core/models.py index 69a5634..8bf5aa2 100644 --- a/ipynbsrv/core/models.py +++ b/ipynbsrv/core/models.py @@ -365,7 +365,8 @@ def get_managers(self): """ managers = self.admins.all() if self.creator: - managers.append(self.creator) + if not self.is_admin(self.creator): + managers.append(self.creator) return managers def get_members(self): @@ -376,7 +377,7 @@ def get_members(self): members = admins + self.get_users() if self.creator: members.append(self.creator) - return set(members) + return list(set(members)) def get_users(self): """