From 3ef1f57a06f703e21b5f427c04736a40d0fe3eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 1 Apr 2024 08:33:35 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20de=20bug=20de=20datas=20no?= =?UTF-8?q?s=20eventos=20e=20reservas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/espacos/views.py | 10 +++++----- sigi/apps/eventos/admin.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sigi/apps/espacos/views.py b/sigi/apps/espacos/views.py index 56461b2..04234d2 100644 --- a/sigi/apps/espacos/views.py +++ b/sigi/apps/espacos/views.py @@ -172,10 +172,10 @@ class UsoEspacos(ReportViewMixin, StaffMemberRequiredMixin, TemplateView): reservas_qs = ( Reserva.objects.filter(q_virtual, status=Reserva.STATUS_ATIVO) .filter( - Q(inicio__range=(data_inicio, data_fim)) - | Q(termino__range=(data_inicio, data_fim)) + Q(data_inicio__range=(data_inicio, data_fim)) + | Q(data_termino__range=(data_inicio, data_fim)) ) - .order_by("inicio", "termino") + .order_by("data_inicio", "data_termino") ) if agrupar_espacos: @@ -184,8 +184,8 @@ class UsoEspacos(ReportViewMixin, StaffMemberRequiredMixin, TemplateView): q_virtual, reserva__status=Reserva.STATUS_ATIVO ) .filter( - Q(reserva__inicio__range=(data_inicio, data_fim)) - | Q(reserva__termino__range=(data_inicio, data_fim)) + Q(reserva__data_inicio__range=(data_inicio, data_fim)) + | Q(reserva__data_termino__range=(data_inicio, data_fim)) ) .distinct() .prefetch_related( diff --git a/sigi/apps/eventos/admin.py b/sigi/apps/eventos/admin.py index f2bd275..27f0016 100644 --- a/sigi/apps/eventos/admin.py +++ b/sigi/apps/eventos/admin.py @@ -1229,7 +1229,7 @@ class EventoAdmin(AsciifyQParameter, CartExportReportMixin, admin.ModelAdmin): "pagemargin": modelo.margem, "evento": evento, "servidor": servidor, - "data": evento.data_inicio.date(), + "data": evento.data_inicio, } ) string = Template(template_string).render(context)