forked from DGNum/gestioCOF
Fusion BdA
- Les tirages ont un champ `active` pour indiquer si le tirage doit être affiché ou considéré comme archivé. - La page d'accueil n'affiche que les tirages actifs. - Le formulaire d'inscription ne propose plus que les spectacles du tirage concerné.
This commit is contained in:
parent
366daf7240
commit
759893f728
4 changed files with 26 additions and 14 deletions
10
bda/views.py
10
bda/views.py
|
@ -133,10 +133,16 @@ def inscription(request, tirage_id):
|
|||
{ "error_title": "C'est fini !",
|
||||
"error_description": u"Tirage au sort dans la journée !",
|
||||
"choices": choices})
|
||||
BdaFormSet = inlineformset_factory(Participant,
|
||||
def formfield_callback(f, **kwargs):
|
||||
if f.name == "spectacle":
|
||||
kwargs['queryset'] = Spectacle.objects.filter(tirage=tirage)
|
||||
return f.formfield(**kwargs)
|
||||
BdaFormSet = inlineformset_factory(
|
||||
Participant,
|
||||
ChoixSpectacle,
|
||||
fields=("spectacle","double_choice","priority"),
|
||||
formset=BaseBdaFormSet)
|
||||
formset=BaseBdaFormSet,
|
||||
formfield_callback=formfield_callback)
|
||||
participant, created = Participant.objects.get_or_create(
|
||||
user=request.user, tirage=tirage)
|
||||
success = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue