From 8a199777574848aaae1ec3bed6dbbc22832038ec Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Thu, 3 May 2018 11:55:34 +0200 Subject: [PATCH] =?UTF-8?q?Ne=20r=C3=A9invente=20pas=20la=20roue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/forms.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/users/forms.py b/users/forms.py index 91e2936a..f939c6cd 100644 --- a/users/forms.py +++ b/users/forms.py @@ -454,23 +454,15 @@ class GroupForm(FormRevMixin, ModelForm): widget=forms.CheckboxSelectMultiple, required=False ) - superuser = forms.BooleanField( - label="Superuser", - required=False, - ) class Meta: model = User - fields = ['groups'] + fields = ['groups', 'is_superuser'] def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(GroupForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['superuser'].initial = self.instance.is_superuser - - def save(self, *args, **kwargs): - self.instance.is_superuser = self.cleaned_data['superuser'] - return super(GroupForm, self).save(*args, **kwargs) + self.fields['is_superuser'].label = "Superuser" class SchoolForm(FormRevMixin, ModelForm):