Merge pull request 'feat: change user_update api response, and add the basic and session auth to rest framework config file' (#36) from behruz into main
Some checks failed
Deploy to Production / build-and-deploy (push) Failing after 1m26s
Some checks failed
Deploy to Production / build-and-deploy (push) Failing after 1m26s
Reviewed-on: #36
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
from typing import Any, Union
|
||||
|
||||
REST_FRAMEWORK: Union[Any] = {
|
||||
"DEFAULT_AUTHENTICATION_CLASSES": ("rest_framework_simplejwt.authentication.JWTAuthentication",),
|
||||
"DEFAULT_AUTHENTICATION_CLASSES": (
|
||||
"rest_framework.authentication.SessionAuthentication",
|
||||
"rest_framework.authentication.BaseAuthentication",
|
||||
"rest_framework_simplejwt.authentication.JWTAuthentication",
|
||||
),
|
||||
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
||||
"DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.IsAuthenticated"],
|
||||
"DEFAULT_PAGINATION_CLASS": "django_core.paginations.CustomPagination",
|
||||
|
||||
@@ -183,8 +183,8 @@ class MeView(BaseViewSetMixin, GenericViewSet, UserService):
|
||||
def user_update(self, request):
|
||||
ser = self.get_serializer(instance=request.user, data=request.data, partial=True)
|
||||
ser.is_valid(raise_exception=True)
|
||||
ser.save()
|
||||
return Response({"detail": _("Malumotlar yangilandi")})
|
||||
data = ser.save()
|
||||
return Response(UserSerializer(data).data)
|
||||
|
||||
|
||||
@extend_schema(tags=["change-password"], description="Parolni o'zgartirish uchun")
|
||||
|
||||
Reference in New Issue
Block a user