mirror of
https://github.com/Ai-hack-MAGNUM-OPUS/backend.git
synced 2024-11-22 00:06:34 +03:00
19 lines
453 B
Python
19 lines
453 B
Python
import asyncio
|
|
|
|
import docx2txt
|
|
from django.db.models.signals import post_save
|
|
from django.dispatch import receiver
|
|
|
|
from checker.models import Docx, Paragraph
|
|
from checker.services.file import process_paragraphs
|
|
from checker.tasks import process_file
|
|
import threading
|
|
import asyncio
|
|
|
|
|
|
@receiver(post_save, sender=Docx)
|
|
def create_docs(sender, instance, created, **kwargs):
|
|
if created:
|
|
process_file.apply_async((instance.pk))
|
|
return
|