From 5a6c7aaadfc5833318a962b4090e7acdbfc53972 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Thu, 4 Oct 2018 00:15:47 +0200 Subject: [PATCH] =?UTF-8?q?clubs:=20un=20champ=20plus=20joli=20pour=20la?= =?UTF-8?q?=20short=5Fdescription,=20crack=20vas=20=C3=AAtre=20content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- club/views.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/club/views.py b/club/views.py index ab0e54eb..0266b7a5 100644 --- a/club/views.py +++ b/club/views.py @@ -51,6 +51,16 @@ from django.conf import settings # Custom forms +class ClubEditForm(forms.ModelForm): + class Meta: + model = Club + fields = ['address', 'logo', 'short_description'] + + def __init__(self, *args, **kwargs): + super(ClubEditForm, self).__init__(*args, **kwargs) + self.fields["short_description"].widget = forms.Textarea() + + class MailingForm(forms.ModelForm): class Meta: model = Mailing @@ -410,7 +420,7 @@ class ClubEditView(ClubTabsMixin, CanEditMixin, UpdateView): """ model = Club pk_url_kwarg = "club_id" - fields = ['address', 'logo', 'short_description'] + form_class = ClubEditForm template_name = 'core/edit.jinja' current_tab = "edit"