Source code for

from import BaseCommand

from cms_qe_newsletter import logger
from cms_qe_newsletter.external_services.sync import sync_tasks

[docs]class Command(BaseCommand): """ Command processes the queue to subscribing and unsubscribing on the external services. Usage of command with ````:: python -m cms_qe_newsletter_sync """
[docs] def handle(self, *args, **options):'Newsletter sync started...') for task_result, task_message in sync_tasks(): if task_result is None: logger.warning(task_message) elif task_result is False: logger.error(task_message) else:'Newsletter sync finished...')