* unit tests updated

* some permission issues fixed

see #204
This commit is contained in:
Antoine Nguyen
2012-04-09 20:07:09 +02:00
parent ec0904cb8b
commit a4b5ebafd9
8 changed files with 189 additions and 104 deletions
+3 -2
View File
@@ -220,8 +220,9 @@ class AccountFormGeneral(forms.ModelForm):
def __init__(self, user, *args, **kwargs):
super(AccountFormGeneral, self).__init__(*args, **kwargs)
self.fields["is_active"].label = _("Enabled")
self.user = user
if user.belongs_to_group("DomainAdmins"):
if user.group == "DomainAdmins":
del self.fields["role"]
return
@@ -436,7 +437,7 @@ class AccountForm(TabForms):
def check_perms(self, account):
if account.is_superuser:
return False
return account.has_perm("auth.add_user")
return account.has_perm("admin.add_domain")
def _before_is_valid(self, form):
if form["id"] == "general":