def ready(self):
from pretalx.event.models import Event
from pretalx.common.tasks import regenerate_css
from django.db import connection, utils
if Event._meta.db_table not in connection.introspection.table_names():
# commands like `compilemessages` execute ready(), but do not
# require a database to be present. Bail out early, if the Event
# table has not been created yet.
return
try:
for event in Event.objects.all():
regenerate_css.apply_async(args=(event.pk,))
except (utils.OperationalError, utils.ProgrammingError):
pass
评论列表
文章目录