Ver Fonte

[oozie] Fix creating a new workflow where we used to look for a document

New workflow do not have any document persisted yey, and don't have any history
Romain Rigaux há 10 anos atrás
pai
commit
a564683fb5

+ 1 - 1
apps/oozie/src/oozie/templates/editor2/common_workflow.mako

@@ -334,7 +334,7 @@
         <span data-bind="visible: properties.enableMail">
           <div class="airy">
             <span class="widget-label" data-bind="text: $root.workflow_properties.to.label"></span>
-            <input type="text" class="seventy" data-bind="value: properties.to, attr: { placeholder: $root.workflow_properties.to.help_text }" validate="nonempty"/>
+            <input type="text" class="seventy" data-bind="value: properties.to, attr: { placeholder: $root.workflow_properties.to.help_text }"/>
           </div>
 
           <div class="airy">

+ 1 - 1
apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

@@ -53,7 +53,7 @@ ${ commonheader(_("Workflow Editor"), "Oozie", user, "40px") | n,unicode }
       <i class="fa fa-fw fa-cog"></i>
     </a>
 
-    <a title="${ _('History') }" rel="tooltip" data-placement="bottom" data-toggle="modal" data-target="#historyModal" data-bind="css: {'btn': true}">
+    <a title="${ _('History') }" rel="tooltip" data-placement="bottom" data-toggle="modal" data-target="#historyModal" data-bind="css: {'btn': true}, visible: workflow.id() != null">
       <i class="fa fa-fw fa-history"></i>
     </a>
 

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

@@ -108,7 +108,7 @@ def _edit_workflow(request, doc, workflow):
           'history': hist.data_dict.get('history', '{}'),
           'id': hist.id,
           'date': hist.last_modified.strftime('%Y-%m-%dT%H:%M')
-        } for hist in doc.get_history()], cls=JSONEncoderForHTML)
+        } for hist in doc.get_history()] if doc else [], cls=JSONEncoderForHTML)
   })