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/views/auth.py Normal file
View File

@@ -0,0 +1,25 @@
from django.utils.translation import gettext as _
from rest_framework import views
from rest_framework import request
from rest_framework import throttling
from core import enums
from core import services
from core.http import serializers
from core.http.views import generics as http_views
class AbstractSendSms(views.APIView, http_views.ApiResponse):
serializer_class = serializers.ResendSerializer
throttle_classes = [throttling.UserRateThrottle]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.service = services.UserService()
def post(self, request: request.Request):
ser = self.serializer_class(data=request.data)
ser.is_valid(raise_exception=True)
phone = ser.data.get("phone")
self.service.send_confirmation(phone)
return self.success(_(enums.Messages.SEND_MESSAGE) % {"phone": phone})