corrects bug with bda-buy

This commit is contained in:
Ludovic Stephan 2016-09-25 14:39:18 +02:00
parent a5e6a8e635
commit bbfce33c3f

View file

@ -440,7 +440,7 @@ def buy_revente(request, spectacle_id):
return render(request, "bda-no-revente.html", {}) return render(request, "bda-no-revente.html", {})
if request.POST: if request.POST:
revente = random.choice(reventes.all(), 1) revente = random.choice(reventes.all())
revente.soldTo = participant revente.soldTo = participant
revente.save() revente.save()
mail = """Bonjour ! mail = """Bonjour !
@ -456,7 +456,7 @@ Contacte-moi si tu es toujours intéressé·e !
[revente.seller.user.email], [revente.seller.user.email],
fail_silently=False) fail_silently=False)
return render(request, "bda-success.html", return render(request, "bda-success.html",
{"seller": revente.participant.user, {"seller": revente.attribution.participant.user,
"spectacle": spectacle}) "spectacle": spectacle})
return render(request, "revente-confirm.html", return render(request, "revente-confirm.html",