Эх сурвалжийг харах

HUE-8792: [notebook] Error while share documents(user can save document with only read permissions)

Mykhailo Kysliuk 6 жил өмнө
parent
commit
bc2241f014

+ 2 - 1
desktop/libs/notebook/src/notebook/decorators.py

@@ -79,7 +79,8 @@ def check_document_modify_permission():
 
       try:
         if notebook.get('id'):
-          doc2 = Document2.objects.get(id=notebook['id'])
+          doc2 = Document2.objects.get(uuid=notebook['parentSavedQueryUuid']) if notebook.get('parentSavedQueryUuid') else \
+            Document2.objects.get(id=notebook['id'])
           doc2.can_write_or_exception(request.user)
       except Document.DoesNotExist:
         raise PopupException(_('Document %(id)s does not exist') % {'id': notebook.get('id')})