瀏覽代碼

[sentry] Fix Hive autocomplete error on columns with API v1

Romain Rigaux 9 年之前
父節點
當前提交
53b3cb7
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      apps/security/src/security/api/hive.py

+ 7 - 3
apps/security/src/security/api/hive.py

@@ -37,18 +37,22 @@ def fetch_hive_path(request):
 
   database = None
   table = None
+  column = None
+
   if path:
     database = path
   if '/' in path:
-    database, table = path.split('/')
+    database, table = path.split('/', 1)
+    if '.' in table:
+      table, column  = table.split('.', 1)
 
-  resp = autocomplete(request, database, table)
+  resp = autocomplete(request, database, table, column)
 
   if database and request.GET['doas'] != request.user.username:
     request.GET = request.GET.copy()
     request.GET['doas'] = request.GET['doas']
 
-    resp = autocomplete(request, database, table)
+    resp = autocomplete(request, database, table, column)
 
   return resp