Răsfoiți Sursa

HUE-3435 [oozie] Do not break the history when passed workflows have some credentials

Romain Rigaux 9 ani în urmă
părinte
comite
dc6936b3c5

+ 7 - 5
apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

@@ -374,11 +374,13 @@ ${ workflow.render() }
           <!-- ko foreach: Object.keys($data.history.properties) -->
           <dt data-bind="text: $data"></dt>
           <dd>
-            <!-- ko if: typeof $parent.history.properties[$data]() == 'string' && $parent.history.properties[$data]().indexOf('/') == 0 -->
-              <a data-bind="text: $parent.history.properties[$data], attr: { href: '/filebrowser/view=' + $root.workflow.properties.deployment_dir() }" target="_blank"></a>
-            <!-- /ko -->
-            <!-- ko ifnot: typeof $parent.history.properties[$data]() == 'string' && $parent.history.properties[$data]().indexOf('/') == 0 -->
-            <span data-bind="text: $parent.history.properties[$data]"></span>
+            <!-- ko if: typeof $parent.history.properties[$data] == 'function' -->
+              <!-- ko if: typeof $parent.history.properties[$data]() == 'string' && $parent.history.properties[$data]().indexOf('/') == 0 -->
+                <a data-bind="text: $parent.history.properties[$data], attr: { href: '/filebrowser/view=' + $root.workflow.properties.deployment_dir() }" target="_blank"></a>
+              <!-- /ko -->
+              <!-- ko ifnot: typeof $parent.history.properties[$data]() == 'string' && $parent.history.properties[$data]().indexOf('/') == 0 -->
+              <span data-bind="text: $parent.history.properties[$data]"></span>
+              <!-- /ko -->
             <!-- /ko -->
           </dd>
           <!-- /ko -->

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

@@ -107,7 +107,7 @@ def _edit_workflow(request, doc, workflow):
       'subworkflows_json': json.dumps(_get_workflows(request.user), cls=JSONEncoderForHTML),
       'can_edit_json': json.dumps(doc is None or doc.doc.get().is_editable(request.user)),
       'history_json': json.dumps([{
-          'history': hist.data_dict.get('history', '{}'),
+          'history': hist.data_dict.get('history', {}),
           'id': hist.id,
           'expanded': False,
           'date': hist.last_modified.strftime('%Y-%m-%dT%H:%M')