pandora_cms/tasks.py

10 lines
362 B
Python
Raw Normal View History

2018-08-07 14:02:46 +00:00
# -*- coding: utf-8 -*-
from celery.task import periodic_task
@periodic_task(run_every=timedelta(hours=1), queue='encoding')
def subtitles_user(**kwargs):
import annotation.models
from user.models import User
u = User.object.get(username='subtitles')
annotation.models.Annotation.objects.filter(layer='subtitles').exclude(user=u).update(user=u)