gère les places demandées

This commit is contained in:
Ludovic Stephan 2016-09-04 11:14:09 +02:00
parent a607f35342
commit e9e0be7960
4 changed files with 59 additions and 1 deletions

View file

@ -318,6 +318,20 @@ def revente(request, tirage_id):
"annulform": annulform, "resellform": resellform})
@login_required
def revente_interested(request, revente_id):
revente = get_object_or_404(SpectacleRevente, id=revente_id)
participant, created = Participant.objects.get_or_create(
user=request.user, tirage=revente.attribution.spectacle.tirage)
if timezone.now() < revente.date + timedelta(hours=1) or revente.shotgun:
return render(request, "bda-wrongtime.html", {})
revente.interested.add(participant)
return render(request, "bda-interested.html",
{"spectacle": revente.attribution.spectacle,
"date": revente.expiration_time})
@login_required
def list_revente(request, tirage_id):
tirage = get_object_or_404(Tirage, id=tirage_id)
@ -373,7 +387,7 @@ def buy_revente(request, spectacle_id):
revente.save()
mail = """Bonjour !
Je souhaiterais racheter ta place pour %s le %s (%s) à %.02f.
Je souhaiterais racheter ta place pour %s le %s (%s) à %.02f.
Contacte-moi si tu es toujours intéressé·e !
%s (%s)""" % (spectacle.title, spectacle.date_no_seconds(),