From 2bdddbced8572eda8e9b5e996c9d36d68abb1aef Mon Sep 17 00:00:00 2001 From: bkfox Date: Wed, 20 May 2020 12:42:43 +0200 Subject: [PATCH] fix issue #10 --- aircox/management/commands/diffusions.py | 4 ++-- scripts/cron | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aircox/management/commands/diffusions.py b/aircox/management/commands/diffusions.py index cf21c9f..12011cc 100755 --- a/aircox/management/commands/diffusions.py +++ b/aircox/management/commands/diffusions.py @@ -19,7 +19,7 @@ import datetime import logging from argparse import RawTextHelpFormatter -from django.core.management.base import BaseCommand, CommandError +from django.core.management.base import BaseCommand from django.db import transaction from django.utils import timezone as tz @@ -76,7 +76,7 @@ class Actions: items.append(diffusion.id) logger.info('[check] %d diffusions will be removed', len(items)) - if len(items): + if items: Diffusion.objects.filter(id__in=items).delete() diff --git a/scripts/cron b/scripts/cron index 0224e0c..dd307b5 100755 --- a/scripts/cron +++ b/scripts/cron @@ -3,9 +3,9 @@ # aircox daily tasks: # - diffusions monitoring for the current month cd /srv/apps/aircox/ -scripts/launch_in_venv ./manage.py diffusions --update --clean --check --mode auto +scripts/launch_in_venv ./manage.py diffusions --update --clean --check # - diffusions monitoring for the next month -scripts/launch_in_venv ./manage.py diffusions --update --next-month --mode auto +scripts/launch_in_venv ./manage.py diffusions --update --next-month cd - # - archiver monitoring for the next month