Don't grant access to the same object twice :p

see #265
This commit is contained in:
Antoine Nguyen
2012-06-25 16:26:52 +02:00
parent 560e119606
commit f8b3350a1d
+1 -1
View File
@@ -63,7 +63,7 @@ def grant_access_to_object(user, obj, is_owner=False):
if is_owner:
from modoboa.admin.models import User
for su in User.objects.filter(is_superuser=True):
if su != user:
if su != user and su != obj:
ObjectAccess.objects.create(user=su, content_type=ct, object_id=obj.id)
except IntegrityError, e: