mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:22:26 +00:00
Fix #117 : Use unix_name instead of name for ldap groups
A group in the LDAP now use the `unix_name` instead of the `name` The `new_group` form has now a more logical order for the fields The label for the `unix_name` is now more explicit
This commit is contained in:
parent
40247e326d
commit
5706e9064e
2 changed files with 8 additions and 7 deletions
|
@ -501,7 +501,7 @@ class ShellForm(FormRevMixin, ModelForm):
|
|||
|
||||
class ListRightForm(FormRevMixin, ModelForm):
|
||||
"""Edition, d'un groupe , équivalent à un droit
|
||||
Ne peremet pas d'editer le gid, car il sert de primary key"""
|
||||
Ne permet pas d'editer le gid, car il sert de primary key"""
|
||||
permissions = forms.ModelMultipleChoiceField(
|
||||
Permission.objects.all().select_related('content_type'),
|
||||
widget=forms.CheckboxSelectMultiple,
|
||||
|
@ -510,23 +510,24 @@ class ListRightForm(FormRevMixin, ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = ListRight
|
||||
fields = ['name', 'unix_name', 'critical', 'permissions', 'details']
|
||||
fields = ('name', 'unix_name', 'critical', 'permissions', 'details')
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
|
||||
super(ListRightForm, self).__init__(*args, prefix=prefix, **kwargs)
|
||||
self.fields['unix_name'].label = 'Nom du droit/groupe'
|
||||
self.fields['unix_name'].label = 'Nom UNIX du groupe'
|
||||
|
||||
|
||||
class NewListRightForm(ListRightForm):
|
||||
"""Ajout d'un groupe/list de droit """
|
||||
class Meta(ListRightForm.Meta):
|
||||
fields = '__all__'
|
||||
fields = ('name', 'unix_name', 'gid', 'critical', 'permissions',
|
||||
'details')
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(NewListRightForm, self).__init__(*args, **kwargs)
|
||||
self.fields['gid'].label = 'Gid, attention, cet attribut ne doit\
|
||||
pas être modifié après création'
|
||||
self.fields['gid'].label = ("Gid, attention, cet attribut ne doit "
|
||||
"pas être modifié après création")
|
||||
|
||||
|
||||
class DelListRightForm(Form):
|
||||
|
|
|
@ -1175,7 +1175,7 @@ class ListRight(RevMixin, AclMixin, Group):
|
|||
group_ldap = LdapUserGroup.objects.get(gid=self.gid)
|
||||
except LdapUserGroup.DoesNotExist:
|
||||
group_ldap = LdapUserGroup(gid=self.gid)
|
||||
group_ldap.name = self.listright
|
||||
group_ldap.name = self.unix_name
|
||||
group_ldap.members = [user.pseudo for user
|
||||
in self.user_set.all()]
|
||||
group_ldap.save()
|
||||
|
|
Loading…
Reference in a new issue