diff --git a/apiserver/plane/api/views/cycle.py b/apiserver/plane/api/views/cycle.py index 36c54c54c..f61a93487 100644 --- a/apiserver/plane/api/views/cycle.py +++ b/apiserver/plane/api/views/cycle.py @@ -414,10 +414,11 @@ class CycleDateCheckEndpoint(BaseAPIView): try: start_date = request.data.get("start_date", False) end_date = request.data.get("end_date", False) + cycle_id = request.data.get("cycle_id", False) if not start_date or not end_date: return Response( - {"error": "Start date and end date both are required"}, + {"error": "Start date and end date are required"}, status=status.HTTP_400_BAD_REQUEST, ) @@ -429,6 +430,11 @@ class CycleDateCheckEndpoint(BaseAPIView): project_id=project_id, ) + if cycle_id: + cycles = cycles.filter( + ~Q(pk=cycle_id), + ) + if cycles.exists(): return Response( {