forked from DGNum/gestioCOF
Empty SpectacleRevente and ChoixRevente before do_tirage.
- Usefull if a tirage is launched more than once. - Ensure full reset of reventes for this tirage in this case.
This commit is contained in:
parent
9f307c1bd0
commit
d31101aff3
1 changed files with 12 additions and 0 deletions
12
bda/views.py
12
bda/views.py
|
@ -337,6 +337,18 @@ def do_tirage(tirage_elt, token):
|
|||
# On inscrit à BdA-Revente ceux qui n'ont pas eu les places voulues
|
||||
ChoixRevente = Participant.choicesrevente.through
|
||||
|
||||
# Suppression des reventes demandées/enregistrées (si le tirage est relancé)
|
||||
(
|
||||
ChoixRevente.objects
|
||||
.filter(spectacle__tirage=tirage_elt)
|
||||
.delete()
|
||||
)
|
||||
(
|
||||
SpectacleRevente.objects
|
||||
.filter(attribution__spectacle__tirage=tirage_elt)
|
||||
.delete()
|
||||
)
|
||||
|
||||
lost_by = defaultdict(set)
|
||||
for show, _, losers in results:
|
||||
for loser, _, _, _ in losers:
|
||||
|
|
Loading…
Reference in a new issue