mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-18 09:53:56 +01:00
wip: Limits and resellers
* refactoring, limits are working pretty well * domain admins can now create domains (under control) when the limits extension is enabled see #105
This commit is contained in:
@@ -107,14 +107,14 @@ class DomainAdminsPerms(Permissions):
|
||||
return False, getctx("ko", content=content)
|
||||
|
||||
def delete(self, selection):
|
||||
User.objects.filter(id__in=selection).delete()
|
||||
# for s in selection:
|
||||
# user.delete()
|
||||
# try:
|
||||
# mbox = Mailbox.objects.get(pk=int(s))
|
||||
# grp = Group.objects.get(name="DomainAdmins")
|
||||
# mbox.user.groups.remove(grp)
|
||||
# mbox.user.save()
|
||||
grp = Group.objects.get(name="DomainAdmins")
|
||||
for uid in selection:
|
||||
u = User.objects.get(pk=uid)
|
||||
u.groups.remove(grp)
|
||||
u.save()
|
||||
events.raiseEvent("DomainAdminDeleted", u)
|
||||
if not len(u.mailbox_set.all()):
|
||||
u.delete()
|
||||
|
||||
def get(self, request):
|
||||
#domadmins = Mailbox.objects.filter(user__groups__name="DomainAdmins")
|
||||
|
||||
Reference in New Issue
Block a user