fix: Use right date input

This commit is contained in:
sinavir 2025-03-17 16:52:04 +01:00 committed by catvayor
parent 3d6358d828
commit fee57cc835
Signed by: lbailly
GPG key ID: CE3E645251AC63F3
2 changed files with 14 additions and 2 deletions

View file

@ -14,6 +14,13 @@ class ClubBudgetLineForm(forms.ModelForm):
widgets = {"date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d")} widgets = {"date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d")}
class ClubBudgetLineFullForm(forms.ModelForm):
class Meta:
model = ClubBudgetLine
fields = ["label", "amount", "date", "posted", "club", "accounting_period"]
widgets = {"date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d")}
class ClubsForm(forms.Form): class ClubsForm(forms.Form):
""" """
Formulaire d'inscription d'un membre à plusieurs clubs du COF. Formulaire d'inscription d'un membre à plusieurs clubs du COF.

View file

@ -10,7 +10,12 @@ from django.views.generic.edit import CreateView, DeleteView, FormView, UpdateVi
from gestioncof.decorators import BuroRequiredMixin from gestioncof.decorators import BuroRequiredMixin
from .forms import ClubBudgetLineCommonForm, ClubBudgetLineForm, ClubBudgetLineFormSet from .forms import (
ClubBudgetLineCommonForm,
ClubBudgetLineForm,
ClubBudgetLineFormSet,
ClubBudgetLineFullForm,
)
from .models import Club, ClubBudgetAccountingPeriod, ClubBudgetLine from .models import Club, ClubBudgetAccountingPeriod, ClubBudgetLine
@ -205,8 +210,8 @@ class BudgetLineUpdate(BudgetLineAccessMixin, UpdateView):
class BudgetLineFullUpdate(BuroRequiredMixin, UpdateView): class BudgetLineFullUpdate(BuroRequiredMixin, UpdateView):
fields = ["label", "amount", "date", "posted", "club", "accounting_period"]
model = ClubBudgetLine model = ClubBudgetLine
form_class = ClubBudgetLineFullForm
def get_success_url(self): def get_success_url(self):
return reverse("cof_clubs:club-detail", kwargs={"pk": self.object.club.id}) return reverse("cof_clubs:club-detail", kwargs={"pk": self.object.club.id})