Skip to content

Commit

Permalink
Merge pull request #706 from bounswe/admin-bug-fix
Browse files Browse the repository at this point in the history
Update hide check
  • Loading branch information
hakanaktas0 authored Dec 25, 2023
2 parents 2efbf76 + 6610c44 commit 45770b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion project/backend/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,10 @@ def update_content_status(request):
user = BasicUser.objects.filter(pk=content_id)
if user.count() > 0:
user = user.first()
user.user.is_active = not hide
if hide == 'True' or hide == True:
user.user.is_active = False
elif hide == 'False' or hide == False:
user.user.is_active = True
user.user.save()
return Response(BasicUserSerializer(user).data, status=200)
except Exception as e:
Expand Down

0 comments on commit 45770b8

Please sign in to comment.