Commit b8a8c3eb authored by liuzheng712's avatar liuzheng712

feat(juser/views.py;func:down_key): delete the private key when user download it

issue:62
parent 2e5c01a4
...@@ -466,6 +466,7 @@ def down_key(request): ...@@ -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.')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment