diff --git a/src/agenda_culturel/forms.py b/src/agenda_culturel/forms.py index 4a93e3e..fec1e18 100644 --- a/src/agenda_culturel/forms.py +++ b/src/agenda_culturel/forms.py @@ -159,12 +159,20 @@ class DynamicArrayWidgetTags(DynamicArrayWidget): class RecurrentImportForm(ModelForm): required_css_class = 'required' + defaultTags = MultipleChoiceField( + label=_("Tags"), + initial=None, + choices=[], + required=False + ) + class Meta: model = RecurrentImport fields = "__all__" - widgets = { - "defaultTags": DynamicArrayWidgetTags(), - } + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.fields["defaultTags"].choices = Tag.get_tag_groups(all=True) class CategorisationRuleImportForm(ModelForm): diff --git a/src/agenda_culturel/templates/agenda_culturel/recurrentimport_form.html b/src/agenda_culturel/templates/agenda_culturel/recurrentimport_form.html index 6b3831b..6deebaa 100644 --- a/src/agenda_culturel/templates/agenda_culturel/recurrentimport_form.html +++ b/src/agenda_culturel/templates/agenda_culturel/recurrentimport_form.html @@ -6,6 +6,8 @@ {% block configurer-bouton %}{% endblock %} {% block entete_header %} + + @@ -26,4 +28,35 @@ + + {% endblock %} \ No newline at end of file