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

issue:62
pull/79/head
liuzheng712 2016-02-23 14:15:55 +08:00
parent 2e5c01a4da
commit b8a8c3ebf3
1 changed files with 1 additions and 0 deletions

View File

@ -466,6 +466,7 @@ def down_key(request):
f.close()
response = HttpResponse(data, content_type='application/octet-stream')
response['Content-Disposition'] = 'attachment; filename=%s' % os.path.basename(private_key_file)
os.unlink(private_key_file) # delete it
return response
return HttpResponse('No Key File. Contact Admin.')