gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s

This commit is contained in:
2026-04-15 08:59:36 +02:00
commit ab73d05ecc
359 changed files with 14415 additions and 0 deletions

25
core/http/tasks/sms.py Normal file
View File

@@ -0,0 +1,25 @@
"""
Base celery tasks
"""
from celery import shared_task
from django.utils.translation import gettext as _
from core.services import sms_service
from core.utils import console
@shared_task
def SendConfirm(phone, code):
try:
service: sms_service.SendService = sms_service.SendService()
service.send_sms(
phone, _("Sizning Tasdiqlash ko'dingiz: %(code)s") % {"code": code}
)
console.Console().success(f"Success: {phone}-{code}")
except Exception as e:
console.Console().error(
"Error: {phone}-{code}\n\n{error}".format(
phone=phone, code=code, error=e
)
) # noqa