pull/26/head
yumaojun 2015-11-15 22:12:28 +08:00
parent 8b94833ea0
commit a36294a529
1 changed files with 9 additions and 3 deletions

View File

@ -383,15 +383,21 @@ def perm_role_push(request):
key_push = request.POST.get("use_publicKey") key_push = request.POST.get("use_publicKey")
task = Tasks(push_resource) task = Tasks(push_resource)
ret = {} ret = {}
ret_failed = []
if password_push: if password_push:
ret["password_push"] = task.add_multi_user(**role_pass) ret["password_push"] = task.add_multi_user(**role_pass)
if ret["password_push"].get("status") != "success":
ret_failed.append(1)
if key_push: if key_push:
ret["key_push"] = task.push_multi_key(**role_key) ret["key_push"] = task.push_multi_key(**role_key)
if ret["key_push"].get("status") != "success":
ret_failed.append(1)
if ret["password_push"].get("status") == "success" and ret["kye_push"].get("status") == "success": print ret
return HttpResponse(u"推送系统角色: %s" % ','.join(role_names)) if ret_failed:
else:
return HttpResponse(u"推送失败") return HttpResponse(u"推送失败")
else:
return HttpResponse(u"推送系统角色: %s" % ','.join(role_names))