cmsmanage/reservations/management/commands/sync_reservations_with_google_calendar.py

22 lines
551 B
Python

import logging
from django.core.management.base import BaseCommand
from reservations.tasks.sync_google_calendar import (
logger,
sync_reservations_with_google_calendar,
)
class Command(BaseCommand):
def handle(self, *args, verbosity: int, **options):
verbosity_levels = {
0: logging.ERROR,
1: logging.WARNING,
2: logging.INFO,
3: logging.DEBUG,
}
logger.setLevel(verbosity_levels.get(verbosity, logging.WARNING))
sync_reservations_with_google_calendar()