return agent's pk when added

This commit is contained in:
wh1te909 2020-01-05 08:47:42 +00:00
parent 5d7c338c3c
commit 19dd9ff56f
1 changed files with 4 additions and 2 deletions

View File

@ -307,8 +307,10 @@ def add(request):
WinUpdatePolicy(agent=agent, run_time_days=[5, 6]).save()
else:
WinUpdatePolicy(agent=agent).save()
return Response("ok")
return Response({"pk": agent.pk})
else:
return Response("err", status=status.HTTP_400_BAD_REQUEST)
@api_view(["PATCH"])