Browse Source

HUE-9066 [gist] Create a get method

Romain 6 years ago
parent
commit
56352f5bc2
1 changed files with 16 additions and 0 deletions
  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 []