From 4069c6105435075bd38f01d37bbb6f9ec3ca3f3c Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 26 Sep 2024 10:32:41 +0200 Subject: [PATCH] runperiodic: Allow to list all tasks --- src/pretix/base/management/commands/runperiodic.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pretix/base/management/commands/runperiodic.py b/src/pretix/base/management/commands/runperiodic.py index 6467efc05..a6ff0b035 100644 --- a/src/pretix/base/management/commands/runperiodic.py +++ b/src/pretix/base/management/commands/runperiodic.py @@ -50,6 +50,7 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--tasks', action='store', type=str, help='Only execute the tasks with this name ' '(dotted path, comma separation)') + parser.add_argument('--list-tasks', action='store_true', help='Only list all tasks') parser.add_argument('--exclude', action='store', type=str, help='Exclude the tasks with this name ' '(dotted path, comma separation)') @@ -61,6 +62,9 @@ class Command(BaseCommand): for receiver in periodic_task._live_receivers(self): name = f'{receiver.__module__}.{receiver.__name__}' + if options['list_tasks']: + print(name) + continue if options.get('tasks'): if name not in options.get('tasks').split(','): continue