Browse Source

HUE-4156 [oozie] Do not list the managed worklows in the coordinator editor

Romain Rigaux 9 năm trước cách đây
mục cha
commit
981cf11
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      apps/oozie/src/oozie/views/editor2.py

+ 5 - 1
apps/oozie/src/oozie/views/editor2.py

@@ -561,9 +561,13 @@ def edit_coordinator(request):
     workflows = [dict([('uuid', d.content_object.uuid), ('name', d.content_object.name)])
                       for d in Document.objects.available_docs(Document2, request.user).filter(extra='workflow2')]
 
-  if coordinator_id and not filter(lambda a: a['uuid'] == coordinator.data['properties']['workflow'], workflows):
+  if coordinator_id and not filter(lambda a: a['uuid'] == coordinator.data['properties']['workflow'], workflows): # In Hue 4, use dependencies instead
     raise PopupException(_('You don\'t have access to the workflow of this coordinator.'))
 
+  if USE_NEW_EDITOR.get(): # In Hue 4, merge with above
+    workflows = [dict([('uuid', d.uuid), ('name', d.name)])
+                      for d in Document2.objects.documents(request.user, include_managed=False).search_documents(types=['oozie-workflow2'])]
+
   if request.GET.get('format') == 'json': # For Editor
     return JsonResponse({
       'coordinator': coordinator.get_data_for_json(),