forked from DGNum/gestioCOF
Merge branch 'Aufinal/fix_reinit_past' into 'master'
Aufinal/fix reinit past Rajoute quelques vérifications de date lors d'une réinitialisation See merge request !110
This commit is contained in:
commit
b60365ddd6
2 changed files with 10 additions and 8 deletions
|
@ -257,7 +257,8 @@ class SpectacleReventeAdmin(admin.ModelAdmin):
|
|||
Réinitialise les reventes.
|
||||
"""
|
||||
count = queryset.count()
|
||||
for revente in queryset.all():
|
||||
for revente in queryset.filter(
|
||||
attribution__spectacle__date__gte=timezone.now()):
|
||||
revente.date = timezone.now() - timedelta(hours=1)
|
||||
revente.soldTo = None
|
||||
revente.notif_sent = False
|
||||
|
|
|
@ -329,6 +329,7 @@ def revente(request, tirage_id):
|
|||
id=revente_id)
|
||||
if rev.exists():
|
||||
revente = rev.get()
|
||||
if revente.attribution.spectacle.date > timezone.now():
|
||||
revente.date = timezone.now() - timedelta(hours=1)
|
||||
revente.soldTo = None
|
||||
revente.notif_sent = False
|
||||
|
|
Loading…
Reference in a new issue