소스 검색

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

Romain Rigaux 8 년 전
부모
커밋
3658b32b06
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 = []