Supprime les bonnes attributions lors d'un tirage.

Ne supprime plus toutes les attributions en lançant un tirage mais
seulement les attributions du tirage que l'on lance.

Fixes #44
This commit is contained in:
Martin Pépin 2016-06-16 00:39:55 +02:00
parent c81cad77e5
commit daa8e47090

View file

@ -237,7 +237,9 @@ def do_tirage(request, tirage_id):
# FIXME: Établir les conditions de validations (formulaire ?) # FIXME: Établir les conditions de validations (formulaire ?)
# cf. issue #32 # cf. issue #32
if False: if False:
Attribution.objects.all().delete() Attribution.objects.filter(
spectacle__tirage=tirage_elt
).all().delete()
for (show, members, _) in results: for (show, members, _) in results:
for (member, _, _, _) in members: for (member, _, _, _) in members:
attrib = Attribution(spectacle=show, participant=member) attrib = Attribution(spectacle=show, participant=member)