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

Fix durée d'un jeu

This commit is contained in:
Med
2017-07-04 01:47:22 +02:00
parent dee26e3eda
commit 3c9021f8f4
3 changed files with 43 additions and 5 deletions

View File

@ -39,6 +39,11 @@ class JeuForm(ModelForm):
model = Jeu
fields = '__all__'
def clean_nombre_joueurs_max(self):
if self.cleaned_data['nombre_joueurs_max'] < self.cleaned_data['nombre_joueurs_min']:
raise forms.ValidationError("Max ne peut être inférieur à min")
return self.cleaned_data['nombre_joueurs_max']
class EmpruntForm(ModelForm):
class Meta:
model = Emprunt