fix saltid bug

This commit is contained in:
wh1te909 2020-01-05 11:14:47 +00:00
parent 8e48a13891
commit 927ff21b6d
1 changed files with 2 additions and 1 deletions

View File

@ -244,6 +244,7 @@ def delete_agent(request):
try:
user = User.objects.get(username=request.data["agentid"])
agent = get_object_or_404(Agent, agent_id=request.data["agentid"])
saltid = agent.salt_id
user.delete()
agent.delete()
except Exception as e:
@ -260,7 +261,7 @@ def delete_agent(request):
{
"client": "wheel",
"fun": "key.delete",
"match": agent.salt_id,
"match": saltid,
"username": settings.SALT_USERNAME,
"password": settings.SALT_PASSWORD,
"eauth": "pam",