diff --git a/media/forms.py b/media/forms.py index 5903892..44799ce 100644 --- a/media/forms.py +++ b/media/forms.py @@ -30,6 +30,8 @@ class AuteurForm(ModelForm): fields = '__all__' class MediaForm(ModelForm): + auteur = forms.ModelMultipleChoiceField(Auteur.objects.all(), widget=forms.CheckboxSelectMultiple, required=False) + class Meta: model = Media fields = '__all__' diff --git a/users/models.py b/users/models.py index f97f6e3..c28bae9 100644 --- a/users/models.py +++ b/users/models.py @@ -269,11 +269,10 @@ class ClefForm(ModelForm): fields = '__all__' class AdhesionForm(ModelForm): - adherent = forms.ModelMultipleChoiceField(User.objects.all(), widget=forms.CheckboxSelectMultiple) + adherent = forms.ModelMultipleChoiceField(User.objects.all(), widget=forms.CheckboxSelectMultiple, required=False) class Meta: model = Adhesion -# fields = ['annee_debut', 'annee_fin'] fields = '__all__' class RightForm(ModelForm):