From 64bd566a8a504baf4d8bfd5ad658e869d446630c Mon Sep 17 00:00:00 2001 From: Francisco Sandoval Date: Mon, 5 Feb 2024 09:41:42 -0300 Subject: [PATCH] fix update carga vigente anterior --- project/api/management/commands/procesa_zip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/api/management/commands/procesa_zip.py b/project/api/management/commands/procesa_zip.py index 00cb1c2..278c0f6 100644 --- a/project/api/management/commands/procesa_zip.py +++ b/project/api/management/commands/procesa_zip.py @@ -33,7 +33,7 @@ class Command(BaseCommand): print(f'procesa: {filepath}') procesa_zip(filepath) - registro_anterior = GtfsArchivo.objects.filter(vigente=True, id_red = red.id_red) + registro_anterior = GtfsArchivo.objects.filter(vigente=True, id_red = red.id_red).first() if registro_anterior: registro_anterior.vigente = False registro_anterior.save()