# coding=utf-8
from __future__ import absolute_import

from django.conf import settings
from celery import shared_task
from api.tool.generate_gift import generate_gift
from api.models.others import GiftClient
from api.models.coupon import CouponGift

# TODO Should be deleted
# @shared_task
# def channel_number_check(channel):
#     gift = GiftClient()
#     coupon_gift= CouponGift.objects.get(channel=channel)
#
#     if gift.length(channel) >= settings.GIFT_LOWER_LIMIT:
#         return
#
#     generate_gift(coupon_gift.id, total=100)
