forked from DGNum/gestioCOF
Message d'erreur qui ne parle pas de object Voeu
This commit is contained in:
parent
511981e762
commit
b80927efa3
1 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,7 @@ from django.contrib import messages
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.core import serializers
|
from django.core import serializers
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
|
from django.core.exceptions import NON_FIELD_ERRORS
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.db.models import Count, Prefetch
|
from django.db.models import Count, Prefetch
|
||||||
from django.forms.models import inlineformset_factory
|
from django.forms.models import inlineformset_factory
|
||||||
|
@ -188,6 +189,12 @@ def inscription(request, tirage_id):
|
||||||
ChoixSpectacle,
|
ChoixSpectacle,
|
||||||
fields=("spectacle", "double_choice", "priority"),
|
fields=("spectacle", "double_choice", "priority"),
|
||||||
formset=InscriptionInlineFormSet,
|
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":
|
if request.method == "POST":
|
||||||
|
|
Loading…
Reference in a new issue