Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 4a5fd06a authored by Levy--Falk Hugo's avatar Levy--Falk Hugo

Ajout de superusers

parent 6f3fc983
......@@ -454,6 +454,10 @@ class GroupForm(FormRevMixin, ModelForm):
superuser = forms.BooleanField(
class Meta:
model = User
......@@ -462,6 +466,11 @@ class GroupForm(FormRevMixin, ModelForm):
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)
class SchoolForm(FormRevMixin, ModelForm):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment