Browse Source

HUE-2562 [pig] Make example work with non admin

Romain Rigaux 10 years ago
parent
commit
ec9b89b

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

@@ -266,7 +266,7 @@ ${ commonheader(_("Coordinator Editor"), "Oozie", user) | n,unicode }
                 <input type="text" class="filechooser-input dataset-input" data-bind="value: dataset_variable, filechooser: dataset_variable, attr: { placeholder:
                 <input type="text" class="filechooser-input dataset-input" data-bind="value: dataset_variable, filechooser: dataset_variable, attr: { placeholder:
                   dataset_type() == 'input_path' ? '${ _("Required data path dependency to start the worklow") }' :
                   dataset_type() == 'input_path' ? '${ _("Required data path dependency to start the worklow") }' :
                   dataset_type() == 'output_path' ? '${ _("Data path created by the workflow") }' :
                   dataset_type() == 'output_path' ? '${ _("Data path created by the workflow") }' :
-                  '${ _("e.g. 1, 2, 3, /data/logs, coord:nominalTime()") }' },
+                  'e.g. 1, 2, 3, /data/logs, ${"$"}{coord:nominalTime()}' },
                   typeahead: { target: dataset_variable, source: datasetTypeaheadSource, triggerOnFocus: true, multipleValues: true, multipleValuesSeparator: '/', multipleValuesExtractor: '/' }" style="margin-bottom:0; width: 380px" />
                   typeahead: { target: dataset_variable, source: datasetTypeaheadSource, triggerOnFocus: true, multipleValues: true, multipleValuesSeparator: '/', multipleValuesExtractor: '/' }" style="margin-bottom:0; width: 380px" />
               </span>
               </span>
 
 

+ 3 - 0
apps/pig/src/pig/models.py

@@ -87,6 +87,9 @@ class PigScript(Document):
 def create_or_update_script(id, name, script, user, parameters, resources, hadoopProperties, is_design=True):
 def create_or_update_script(id, name, script, user, parameters, resources, hadoopProperties, is_design=True):
   try:
   try:
     pig_script = PigScript.objects.get(id=id)
     pig_script = PigScript.objects.get(id=id)
+    if id == '1100713': # Special case for the Example, just create an history
+      is_design = False
+      raise PigScript.DoesNotExist()
     pig_script.doc.get().can_write_or_exception(user)
     pig_script.doc.get().can_write_or_exception(user)
   except PigScript.DoesNotExist:
   except PigScript.DoesNotExist:
     pig_script = PigScript.objects.create(owner=user, is_design=is_design)
     pig_script = PigScript.objects.create(owner=user, is_design=is_design)