Small code QoL improvements

This commit is contained in:
Ludovic Stephan 2017-10-23 18:59:30 +02:00
parent e74dbb11f1
commit 919bcd197d
2 changed files with 12 additions and 8 deletions

View file

@ -375,13 +375,7 @@ def revente_manage(request, tirage_id):
attribution=attribution,
defaults={'seller': participant})
if not created:
revente.seller = participant
revente.date = timezone.now()
revente.wanted = Participant.objects.none()
revente.soldTo = None
revente.notif_sent = False
revente.tirage_done = False
revente.shotgun = False
revente.reset()
context = {
'vendeur': participant.user,
'show': attribution.spectacle,
@ -495,7 +489,7 @@ def revente_confirm(request, revente_id):
revente = get_object_or_404(SpectacleRevente, id=revente_id)
participant, _ = Participant.objects.get_or_create(
user=request.user, tirage=revente.attribution.spectacle.tirage)
if (timezone.now() < revente.date + timedelta(hours=1)) or revente.shotgun:
if not revente.notif_sent or revente.shotgun:
return render(request, "bda/revente/wrongtime.html",
{"revente": revente})