Skip to content

Commit

Permalink
Use default viewset logic for user patch (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
triklozoid committed Apr 20, 2021
1 parent dd7789b commit f5974e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -41,6 +41,7 @@ archive
*.rtl.min.css
*.idea/*
.vscode/*
pyrightconfig.json
tags
tags.temp
mydatabase
Expand Down
5 changes: 1 addition & 4 deletions label_studio/users/api.py
Expand Up @@ -47,10 +47,7 @@ def avatar(self, request, pk):

@swagger_auto_schema(tags=['Users'], operation_summary='Save user details')
def update(self, request, *args, **kwargs):
form = UserProfileForm(data=request.data, files=request.FILES, instance=request.user)
if form.is_valid():
form.save()
return Response({'detail': 'user details saved'}, status=200)
return super(UserAPI, self).update(request, *args, **kwargs)

@swagger_auto_schema(auto_schema=None)
def list(self, request, *args, **kwargs):
Expand Down

0 comments on commit f5974e0

Please sign in to comment.