浏览代码

HUE-7090 [security] Protect against another potentially missing groupName key

Romain Rigaux 8 年之前
父节点
当前提交
3658b32
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      apps/security/src/security/api/hive.py

+ 1 - 1
apps/security/src/security/api/hive.py

@@ -305,7 +305,7 @@ def list_sentry_privileges_by_authorizable(request):
   result = {'status': -1, 'message': 'Error'}
 
   try:
-    groups = [request.POST['groupName']] if request.POST['groupName'] else None
+    groups = [request.POST['groupName']] if request.POST.get('groupName') else None
     authorizableSet = [json.loads(request.POST['authorizableHierarchy'])]
 
     _privileges = []