1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-07-05 16:43:56 +02:00

Permet l'édition des clefs depuis le campus sans auth

This commit is contained in:
Med
2017-07-16 02:41:44 +02:00
parent 6b7b20d279
commit 7fc044b68f
6 changed files with 156 additions and 21 deletions

View File

@ -145,6 +145,12 @@ class ClefForm(ModelForm):
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)
@ -164,8 +170,11 @@ class RightForm(ModelForm):
class DelRightForm(Form):
rights = forms.ModelMultipleChoiceField(queryset=Right.objects.all(), label="Droits actuels", widget=forms.CheckboxSelectMultiple)
rights = forms.ModelMultipleChoiceField(queryset=Right.objects.all(), widget=forms.CheckboxSelectMultiple)
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: