db_kyc_project/backend/users/views/check_registration.py

11 lines
458 B
Python
Raw Permalink Normal View History

2024-12-10 23:31:35 +03:00
from rest_framework.decorators import api_view, permission_classes, authentication_classes
from rest_framework.response import Response
from rest_framework.status import HTTP_200_OK, HTTP_404_NOT_FOUND
from users.models import TGUser
@api_view()
@permission_classes([])
@authentication_classes([])
def check_registration(request, pk):
return Response(status=HTTP_200_OK) if TGUser.objects.filter(pk=pk).exists() else Response(status=HTTP_404_NOT_FOUND)