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