Files
mayan-edms/mayan/apps/document_states/tasks.py
Roberto Rosario cfe1934b9b Appearance: Fix form CSS media rendering
Fix the way the form CSS contained in the media attribute
is rendered. This is now an interator and not a single value.
Replace the current method with a for loop.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-11-29 01:12:36 -04:00

36 lines
921 B
Python

from __future__ import unicode_literals
import logging
from django.apps import apps
from mayan.celery import app
logger = logging.getLogger(__name__)
@app.task()
def task_generate_workflow_image(document_state_id):
Workflow = apps.get_model(
app_label='document_states', model_name='Workflow'
)
workflow = Workflow.objects.get(pk=document_state_id)
return workflow.generate_image()
@app.task(ignore_result=True)
def task_launch_all_workflows():
Document = apps.get_model(app_label='documents', model_name='Document')
Workflow = apps.get_model(
app_label='document_states', model_name='Workflow'
)
logger.info('Start launching workflows')
for document in Document.objects.all():
logger.debug('Lauching workflows for document ID: %d', document.pk)
Workflow.objects.launch_for(document=document)
logger.info('Finished launching workflows')