Merge pull request #40 from plers-org/sm/#32

Sm/#32
This commit is contained in:
NKEY
2025-04-28 22:12:03 +09:00
committed by GitHub
2 changed files with 2 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ class PortfolioSetRepresentAPIView(APIView):
return Response({"message": "Not owner"}, status=status.HTTP_403_FORBIDDEN) return Response({"message": "Not owner"}, status=status.HTTP_403_FORBIDDEN)
if before_represent := Portfolio.objects.filter(owner=user, is_represent=True).first(): if before_represent := Portfolio.objects.filter(owner=user, is_represent=True).first():
before_represent.is_represent = False before_represent.is_represent = False
before_represent.save()
portfolio.is_represent = True portfolio.is_represent = True
portfolio.save() portfolio.save()
return Response({"message": "change represent success"}, status=status.HTTP_200_OK) return Response({"message": "change represent success"}, status=status.HTTP_200_OK)

View File

@@ -85,6 +85,7 @@ class ProjectSetRepresentAPIView(APIView):
return Response({"message": "Not owner"}, status=status.HTTP_403_FORBIDDEN) return Response({"message": "Not owner"}, status=status.HTTP_403_FORBIDDEN)
if before_represent := Project.objects.filter(owner=user, is_represent=True).first(): if before_represent := Project.objects.filter(owner=user, is_represent=True).first():
before_represent.is_represent = False before_represent.is_represent = False
before_represent.save()
project.is_represent = True project.is_represent = True
project.save() project.save()
return Response({"message": "change represent success"}, status=status.HTTP_200_OK) return Response({"message": "change represent success"}, status=status.HTTP_200_OK)