mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2025-07-06 03:23:55 +02:00
Move clef and listright to admin
This commit is contained in:
@ -49,25 +49,6 @@ class PasswordForm(ModelForm):
|
||||
fields = ['password']
|
||||
|
||||
|
||||
class StateForm(ModelForm):
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ['is_active']
|
||||
|
||||
|
||||
class ClefForm(ModelForm):
|
||||
class Meta:
|
||||
model = Clef
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class BaseClefForm(ClefForm):
|
||||
class Meta(ClefForm.Meta):
|
||||
fields = [
|
||||
'commentaire',
|
||||
]
|
||||
|
||||
|
||||
class AdhesionForm(ModelForm):
|
||||
adherent = forms.ModelMultipleChoiceField(User.objects.all(), widget=forms.CheckboxSelectMultiple, required=False)
|
||||
|
||||
@ -93,23 +74,3 @@ class DelRightForm(Form):
|
||||
def __init__(self, right, *args, **kwargs):
|
||||
super(DelRightForm, self).__init__(*args, **kwargs)
|
||||
self.fields['rights'].queryset = Right.objects.filter(right=right)
|
||||
|
||||
|
||||
class ListRightForm(ModelForm):
|
||||
class Meta:
|
||||
model = ListRight
|
||||
fields = ['listright', 'details']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ListRightForm, self).__init__(*args, **kwargs)
|
||||
self.fields['listright'].label = 'Nom du droit/groupe'
|
||||
|
||||
|
||||
class NewListRightForm(ListRightForm):
|
||||
class Meta(ListRightForm.Meta):
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class DelListRightForm(Form):
|
||||
listrights = forms.ModelMultipleChoiceField(queryset=ListRight.objects.all(), label="Droits actuels",
|
||||
widget=forms.CheckboxSelectMultiple)
|
||||
|
Reference in New Issue
Block a user