From cb6e80926ef1e34165e5c07c934186e1bcbf4ec2 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sat, 11 Jul 2015 01:49:15 -0400 Subject: [PATCH] Add management command to purge periodic tasks from the DB. --- .../common/management/commands/purgeperiodictasks.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 mayan/apps/common/management/commands/purgeperiodictasks.py diff --git a/mayan/apps/common/management/commands/purgeperiodictasks.py b/mayan/apps/common/management/commands/purgeperiodictasks.py new file mode 100644 index 0000000000..823d78c0f8 --- /dev/null +++ b/mayan/apps/common/management/commands/purgeperiodictasks.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals + +from django.core import management + +from djcelery.models import PeriodicTask + + +class Command(management.BaseCommand): + help = 'Removes all periodic tasks.' + + def handle(self, *args, **options): + PeriodicTask.objects.all().delete()