Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2025-06-04 17:03:19 +02:00
parent 66f8377c79
commit 3037701a14
3 changed files with 13 additions and 2 deletions

View File

@ -59,6 +59,14 @@ class Schedule(SerializerModel):
def __str__(self):
return self.uid
@classmethod
def dispatch_by_actor(cls, actor: Actor):
"""Dispatch a schedule by looking up its actor.
Only available for schedules without custom arguments."""
schedule = cls.objects.filter(actor_name=actor.actor_name, paused=False).first()
if schedule:
schedule.send()
@property
def serializer(self):
from authentik.tasks.schedules.api import ScheduleSerializer