From 046fd431a99dc91bf90d3ebb52eb1745832beffb Mon Sep 17 00:00:00 2001 From: Francisco Sandoval Date: Sun, 4 Feb 2024 18:12:35 -0300 Subject: [PATCH] fix procesa zip --- project/api/management/commands/procesa_zip.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/project/api/management/commands/procesa_zip.py b/project/api/management/commands/procesa_zip.py index 5fc5f5f..00cb1c2 100644 --- a/project/api/management/commands/procesa_zip.py +++ b/project/api/management/commands/procesa_zip.py @@ -8,7 +8,6 @@ import csv import zipfile import tempfile import threading -import datetime class Command(BaseCommand): help = 'Procesa los archivos gtfs en formato comprimido (zip)' @@ -16,14 +15,13 @@ class Command(BaseCommand): def handle(self, *args, **options): # Lógica de tu comando aquí folder = config('GTFS_UPLOADS','/tmp') - fecha_hoy = timezone.now().replace(hour=0, minute=0, second=0, microsecond=0) redes = RedTransporte.objects.filter(vigente=True) for red in redes: self.stdout.write(self.style.SUCCESS(f'nombre red: {red.nombre_red}')) gtfs_archivo = GtfsArchivo.objects \ - .filter(vigente=False, id_red = red.id_red, status = 'PENDIENTE', created__gte = fecha_hoy) \ + .filter(vigente=False, id_red = red.id_red, status = 'PENDIENTE') \ .order_by('-created') \ .first()