1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00
webvirtcloud/vmbackups/apps.py
catborise c5a04e040d fix(vmbackups): a schedule's run keeps how its job ended
The run history showed a run as "Started" once the job history (Job
Retention Days, which may be under 14) dropped its job. A run now takes
its job's end, and the reason it failed, when the job is deleted.

- A job cancelled without an error gives "The job was cancelled" as the
  run's reason on the schedule page.
- The Schedules list's 14-day strip is a link to the schedule, so touch
  and keyboard users reach the details its tooltips hold.
- The marks keep their colours in forced-colors (high contrast) mode.
2026-11-26 14:21:35 +03:00

17 lines
501 B
Python

from django.apps import AppConfig
from django.db.models.signals import pre_delete
def keep_job_end(sender, instance, **kwargs):
from .models import BackupRun
BackupRun.keep_job_end(instance)
class VmbackupsConfig(AppConfig):
name = "vmbackups"
verbose_name = "Backups"
def ready(self):
# the job history drops ended jobs (operations.worker.housekeeping); a schedule's run keeps how its job went
pre_delete.connect(keep_job_end, sender="operations.Operation")