浏览代码

HUE-9066 [gist] Create a get method

Romain 6 年之前
父节点
当前提交
56352f5bc2
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      desktop/core/src/desktop/api2.py

+ 16 - 0
desktop/core/src/desktop/api2.py

@@ -821,6 +821,7 @@ def user_preferences(request, key=None):
   return JsonResponse(response)
 
 
+@api_error_handler()
 def gist_create(request):
   response = {'status': 0}
 
@@ -841,6 +842,21 @@ def gist_create(request):
   return JsonResponse(response)
 
 
+@api_error_handler()
+def gist_get(request):
+  response = {'status': 0}
+
+  gist_uuid = request.POST.get('uuid', '')
+  # if get, manage unfurling
+
+  gist_doc = Document2.objects.get(uuid=uuid) # Workaround until there is a share to all permission
+
+  # check type
+  # return new notebook but with default text
+
+  return JsonResponse(response)
+
+
 def search_entities(request):
   sources = json.loads(request.POST.get('sources')) or []