From 8e3df0ec460b7f29795ac1e612542b206be54433 Mon Sep 17 00:00:00 2001 From: lucasmndc Date: Tue, 13 Aug 2024 10:40:46 -0300 Subject: [PATCH] =?UTF-8?q?Migra=C3=A7=C3=B5es=20e=20admin=20ajustados?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/utils/admin.py | 2 +- ...jobschedule_enviado_cronjob_last_digest.py | 24 +++++++++++++++++++ sigi/apps/utils/models.py | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 sigi/apps/utils/migrations/0006_remove_jobschedule_enviado_cronjob_last_digest.py diff --git a/sigi/apps/utils/admin.py b/sigi/apps/utils/admin.py index a444852..598da0c 100644 --- a/sigi/apps/utils/admin.py +++ b/sigi/apps/utils/admin.py @@ -79,7 +79,7 @@ class CronjobAdmin(admin.ModelAdmin): "digest", "last_digest", ] - readonly_fields = ("job_name", "app_name", "get_help") + readonly_fields = ("job_name", "app_name", "get_help", "last_digest") inlines = [JobScheduleInline] def get_urls(self): diff --git a/sigi/apps/utils/migrations/0006_remove_jobschedule_enviado_cronjob_last_digest.py b/sigi/apps/utils/migrations/0006_remove_jobschedule_enviado_cronjob_last_digest.py new file mode 100644 index 0000000..fa4e15c --- /dev/null +++ b/sigi/apps/utils/migrations/0006_remove_jobschedule_enviado_cronjob_last_digest.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.6 on 2024-08-13 13:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("utils", "0005_cronjob_destinatario_email_cronjob_digest_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="jobschedule", + name="enviado", + ), + migrations.AddField( + model_name="cronjob", + name="last_digest", + field=models.DateTimeField( + blank=True, null=True, verbose_name="Ășltimo envio de digest" + ), + ), + ] diff --git a/sigi/apps/utils/models.py b/sigi/apps/utils/models.py index feb8c79..59d720e 100644 --- a/sigi/apps/utils/models.py +++ b/sigi/apps/utils/models.py @@ -1,6 +1,7 @@ import io from contextlib import redirect_stderr, redirect_stdout from cron_converter import Cron +from pyexpat import model from django.db import models from django.contrib.auth.models import Group from django.utils import timezone