summaryrefslogtreecommitdiff
path: root/ishtar_common/management/commands
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/management/commands')
-rw-r--r--ishtar_common/management/commands/ishtar_excute_admin_tasks.py15
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()