Message d'erreur qui ne parle pas de object Voeu

This commit is contained in:
Basile Clement 2018-11-12 22:44:09 +01:00
parent 511981e762
commit b80927efa3

View file

@ -11,6 +11,7 @@ from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.core.urlresolvers import reverse
from django.core.exceptions import NON_FIELD_ERRORS
from django.db import transaction
from django.db.models import Count, Prefetch
from django.forms.models import inlineformset_factory
@ -188,6 +189,12 @@ def inscription(request, tirage_id):
ChoixSpectacle,
fields=("spectacle", "double_choice", "priority"),
formset=InscriptionInlineFormSet,
can_order=True,
error_messages={
NON_FIELD_ERRORS: {
'unique_together': "Vous avez déjà demandé ce voeu plus haut !",
},
}
)
if request.method == "POST":