From d44c843e669c962d852a2b5b8904d27ec26582ad Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Tue, 19 Jan 2016 18:09:35 +0100 Subject: [PATCH] Fix unit tests. see #825 --- modoboa/admin/models/mailbox.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modoboa/admin/models/mailbox.py b/modoboa/admin/models/mailbox.py index 27c39c138..5388ab3b2 100644 --- a/modoboa/admin/models/mailbox.py +++ b/modoboa/admin/models/mailbox.py @@ -266,12 +266,14 @@ class Mailbox(AdminObject): not self.user.has_perm("admin.add_domain") ) if all(conditions): - # A super user is creating a new mailbox. Give + # An admin is creating a new mailbox. Give # access to that mailbox (and the associated # account) to the appropriate domain admins, # except if the new account has a more important # role (SuperAdmin, Reseller) for admin in self.domain.admins: + if admin == creator: + continue grant_access_to_object(admin, self) grant_access_to_object(admin, self.user)