From b8decc1b7533a5101d2533115df67240aab40418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 25 Oct 2023 11:09:55 -0300 Subject: [PATCH] =?UTF-8?q?Refatora=C3=A7=C3=A3o=20para=20melhorar=20consi?= =?UTF-8?q?st=C3=AAncia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/eventos/jobs/daily/encerra_inscricao.py | 9 ++++----- .../apps/eventos/migrations/0051_ajusta_status_evento.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sigi/apps/eventos/jobs/daily/encerra_inscricao.py b/sigi/apps/eventos/jobs/daily/encerra_inscricao.py index 107ef04..9a058f3 100644 --- a/sigi/apps/eventos/jobs/daily/encerra_inscricao.py +++ b/sigi/apps/eventos/jobs/daily/encerra_inscricao.py @@ -25,8 +25,6 @@ class Job(JobReportMixin, DailyJob): .exclude(chave_inscricao=INSCRICOES_ENCERRADAS) ) - total_encerrar = encerrar_inscricao.count() - self.report_data.append(_("Inscrições encerradas")) self.report_data.append("---------------------") self.report_data.append("") @@ -35,12 +33,13 @@ class Job(JobReportMixin, DailyJob): ) self.report_data.append("") - encerrar_inscricao.update(chave_inscricao=INSCRICOES_ENCERRADAS) + total_encerrar = encerrar_inscricao.update( + chave_inscricao=INSCRICOES_ENCERRADAS + ) despublicar = Evento.objects.exclude(publicar=False).filter( data_termino__lte=anteontem ) - total_despublicar = despublicar.count() self.report_data.append(_("Despublicados")) self.report_data.append("-------------") @@ -48,7 +47,7 @@ class Job(JobReportMixin, DailyJob): self.report_data.extend([f"{e.nome} ({e.id})" for e in despublicar]) self.report_data.append("") - despublicar.update(publicar=False) + total_despublicar = despublicar.update(publicar=False) self.report_data.append(_("RESUMO")) self.report_data.append("------") diff --git a/sigi/apps/eventos/migrations/0051_ajusta_status_evento.py b/sigi/apps/eventos/migrations/0051_ajusta_status_evento.py index 61cafa1..8a3a9b6 100644 --- a/sigi/apps/eventos/migrations/0051_ajusta_status_evento.py +++ b/sigi/apps/eventos/migrations/0051_ajusta_status_evento.py @@ -42,4 +42,4 @@ class Migration(migrations.Migration): ("eventos", "0050_alter_evento_total_participantes"), ] - operations = [migrations.RunPython(forwards)] + operations = [migrations.RunPython(forwards, migrations.RunPython.noop)]