diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-01 19:45:55 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-01 19:45:55 +0200 |
commit | 9564fef30591d71f5a38a58d79ef99cc7c632430 (patch) | |
tree | b9072837a0887fac1f6f2315d21372bd60c99ba2 /ishtar_common/management/commands/ishtar_excute_admin_tasks.py | |
parent | 9b773927aaf6549ff52c697cce8009f55b042be8 (diff) | |
download | Ishtar-9564fef30591d71f5a38a58d79ef99cc7c632430.tar.bz2 Ishtar-9564fef30591d71f5a38a58d79ef99cc7c632430.zip |
Add the ability to scheduled administration task inside Django admin
Diffstat (limited to 'ishtar_common/management/commands/ishtar_excute_admin_tasks.py')
-rw-r--r-- | ishtar_common/management/commands/ishtar_excute_admin_tasks.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ishtar_common/management/commands/ishtar_excute_admin_tasks.py b/ishtar_common/management/commands/ishtar_excute_admin_tasks.py new file mode 100644 index 000000000..3fe66ad3b --- /dev/null +++ b/ishtar_common/management/commands/ishtar_excute_admin_tasks.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from django.core.management.base import BaseCommand, CommandError + +from ishtar_common import models + + +class Command(BaseCommand): + help = "./manage.py ishtar_execute_admin_tasks\n\n"\ + "Launch pending administration tasks." + + def handle(self, *args, **options): + for task in models.AdministrationTask.objects.filter(state='S').all(): + task.execute() |