mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-01 14:48:13 +00:00
feat(juser/views.py;func:down_key): delete the private key when user download it
issue:62
This commit is contained in:
parent
2e5c01a4da
commit
b8a8c3ebf3
@ -466,6 +466,7 @@ def down_key(request):
|
|||||||
f.close()
|
f.close()
|
||||||
response = HttpResponse(data, content_type='application/octet-stream')
|
response = HttpResponse(data, content_type='application/octet-stream')
|
||||||
response['Content-Disposition'] = 'attachment; filename=%s' % os.path.basename(private_key_file)
|
response['Content-Disposition'] = 'attachment; filename=%s' % os.path.basename(private_key_file)
|
||||||
|
os.unlink(private_key_file) # delete it
|
||||||
return response
|
return response
|
||||||
return HttpResponse('No Key File. Contact Admin.')
|
return HttpResponse('No Key File. Contact Admin.')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user