diff --git a/juser/views.py b/juser/views.py index 64535f3fe..a5978c80d 100644 --- a/juser/views.py +++ b/juser/views.py @@ -453,7 +453,6 @@ def down_key(request): uuid_r = request.GET.get('uuid', '') else: uuid_r = request.user.uuid - if uuid_r: user = get_object(User, uuid=uuid_r) if user: @@ -466,7 +465,8 @@ 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) + if request.user.role == 'CU': + os.unlink(private_key_file) return response return HttpResponse('No Key File. Contact Admin.') diff --git a/templates/juser/user_list.html b/templates/juser/user_list.html index f17fb9e03..7968e889e 100644 --- a/templates/juser/user_list.html +++ b/templates/juser/user_list.html @@ -70,7 +70,7 @@ {% if user.username|key_exist %} 下载 {% else %} - NoKey + NoKey GenOne? {% endif %}