clean up swagger

This commit is contained in:
Parsa Nazer
2025-03-27 22:15:31 +03:30
parent d36a073e71
commit 6d61508ea2
4 changed files with 32 additions and 10 deletions
+7 -1
View File
@@ -6,7 +6,7 @@ from .serializers import *
from .models import UserAddressModel, User, SecurityBreachAttemptModel
from rest_framework.permissions import IsAuthenticated, AllowAny
from drf_spectacular.utils import extend_schema, OpenApiParameter, extend_schema_view
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from django.shortcuts import get_object_or_404, redirect
from rest_framework_simplejwt.tokens import RefreshToken
import ghasedak_sms
@@ -65,6 +65,12 @@ Code: {otp}"""
except Exception as e:
return Response({'detail': f'error: {e} مشتی فعلا برو تو غمت نباشه تا بعدا یه کاریش بکنم', 'otp_code': otp}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
# return Response({'detail': f'An error occurred: {e}'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
@extend_schema_view(
post=extend_schema(tags=['authentication'])
)
class TokenRefreshView(TokenRefreshView):
pass
class CustomTokenObtainPairView(TokenObtainPairView):