mirror of
https://github.com/magnum-opus-nn-cp/backend.git
synced 2025-02-23 23:20:41 +03:00
12 lines
379 B
Python
12 lines
379 B
Python
from django.db.models.signals import post_save
|
|
from django.dispatch import receiver
|
|
|
|
from press_release_nl.processor.models import Text
|
|
from press_release_nl.processor.tasks import load_text
|
|
|
|
|
|
@receiver(post_save, sender=Text)
|
|
def run_text_process(sender, instance: Text, created, **kwargs):
|
|
if created:
|
|
load_text.apply_async(kwargs={"pk": instance.pk}, countdown=1)
|