gault-millau/apps/collection/tasks.py

22 lines
658 B
Python

"""Collectoin app celery tasks."""
import logging
from celery import shared_task
from django.utils.translation import gettext_lazy as _
from collection import models as collection_models
logging.basicConfig(format='[%(levelname)s] %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
# todo: finish this
@shared_task
def generate_guide_elements(guide_id: int):
"""Send verification email to user."""
try:
obj = collection_models.Guide.objects.get(id=guide_id)
except Exception as e:
logger.error(f'METHOD_NAME: {generate_guide_elements.__name__}\n'
f'DETAIL: guide {guide_id}, - {e}')