Skip to content

Commit 106f4b9

Browse files
committed
fix: typo in AgentRetrieveUpdateView
1 parent c9f98c9 commit 106f4b9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/agents/views.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,16 @@ def patch(self, request, *args, **kwargs):
214214
"""
215215
Update agent status
216216
"""
217+
if request.data:
218+
return Response(
219+
{"error": "This endpoint does not accept any data in the request"},
220+
status=status.HTTP_400_BAD_REQUEST
221+
)
222+
217223
agent = self.get_object()
218224

219225
# Toggle the status (no frontend input needed)
220-
agent.status = "inactive" if instance.status == "active" else "active"
226+
agent.status = "inactive" if agent.status == "active" else "active"
221227
agent.save()
222228

223229
return Response(

0 commit comments

Comments
 (0)