diff --git a/portfolios/views.py b/portfolios/views.py index 92cc45f..e715aec 100644 --- a/portfolios/views.py +++ b/portfolios/views.py @@ -56,6 +56,7 @@ class PortfolioSetRepresentAPIView(APIView): return Response({"message": "Not owner"}, status=status.HTTP_403_FORBIDDEN) if before_represent := Portfolio.objects.filter(owner=user, is_represent=True).first(): before_represent.is_represent = False + before_represent.save() portfolio.is_represent = True portfolio.save() return Response({"message": "change represent success"}, status=status.HTTP_200_OK) diff --git a/projects/views.py b/projects/views.py index d111d6a..64c8da8 100644 --- a/projects/views.py +++ b/projects/views.py @@ -85,6 +85,7 @@ class ProjectSetRepresentAPIView(APIView): return Response({"message": "Not owner"}, status=status.HTTP_403_FORBIDDEN) if before_represent := Project.objects.filter(owner=user, is_represent=True).first(): before_represent.is_represent = False + before_represent.save() project.is_represent = True project.save() return Response({"message": "change represent success"}, status=status.HTTP_200_OK)