Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复不能在 swagger 页面中上传头像文件的问题 #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions drf_admin/apps/information/views/centre.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""
from rest_framework import mixins
from rest_framework.generics import GenericAPIView
from rest_framework.parsers import MultiPartParser

from information.serializers.centre import ChangePasswordSerializer, ChangeInformationSerializer, ChangeAvatarSerializer

Expand Down Expand Up @@ -52,6 +53,7 @@ class ChangeAvatarAPIView(mixins.UpdateModelMixin, GenericAPIView):
个人中心修改个人头像, status: 200(成功), return: 修改后的个人信息
"""
serializer_class = ChangeAvatarSerializer
parser_classes = (MultiPartParser,)

def put(self, request, *args, **kwargs):
return self.update(request, *args, **kwargs)
Expand Down