Browse Source

HUE-1573 [beeswax] Save query button fails

Adding error in logs now instead of failing silently
Romain Rigaux 12 years ago
parent
commit
6439222c69

+ 4 - 4
apps/beeswax/src/beeswax/templates/execute.mako

@@ -565,9 +565,9 @@ ${layout.menubar(section='query')}
 
       $("#saveQuery").click(function () {
         $("<input>").attr("type", "hidden").attr("name", "saveform-name")
-                .attr("value", $("#query-name").val()).appendTo($("#advancedSettingsForm"));
+                .attr("value", $("#query-name").data('value')).appendTo($("#advancedSettingsForm"));
         $("<input>").attr("type", "hidden").attr("name", "saveform-desc")
-                .attr("value", $("#query-description").val()).appendTo($("#advancedSettingsForm"));
+                .attr("value", $("#query-description").data('value')).appendTo($("#advancedSettingsForm"));
         $("<input>").attr("type", "hidden").attr("name", "saveform-save").attr("value", "Save").appendTo($("#advancedSettingsForm"));
         checkAndSubmit();
       });
@@ -579,9 +579,9 @@ ${layout.menubar(section='query')}
 
       $("#saveAsNameBtn").click(function () {
         $("<input>").attr("type", "hidden").attr("name", "saveform-name")
-                .attr("value", $("input[name=saveform-name]").val()).appendTo($("#advancedSettingsForm"));
+                .attr("value", $("input[name=saveform-name]").data('value')).appendTo($("#advancedSettingsForm"));
         $("<input>").attr("type", "hidden").attr("name", "saveform-desc")
-                .attr("value", $("input[name=saveform-desc]").val()).appendTo($("#advancedSettingsForm"));
+                .attr("value", $("input[name=saveform-desc]").data('value')).appendTo($("#advancedSettingsForm"));
         checkAndSubmit();
       });
 

+ 10 - 3
desktop/core/src/desktop/lib/django_forms.py

@@ -17,6 +17,10 @@
 #
 # Extra form fields and widgets.
 
+import logging
+import simplejson
+import urllib
+
 from django.forms import Widget, Field
 from django import forms
 from django.forms.util import ErrorList, ValidationError, flatatt
@@ -26,10 +30,12 @@ from django.utils import formats
 from django.utils.safestring import mark_safe
 from django.utils.encoding import StrAndUnicode, force_unicode
 
-import simplejson
-import urllib
-
 import desktop.lib.i18n
+from desktop.lib.i18n import smart_str
+
+
+LOG = logging.getLogger(__name__)
+
 
 class SplitDateTimeWidget(forms.MultiWidget):
   """
@@ -305,6 +311,7 @@ class MultiForm(object):
     # to abort early, since we want each form's is_valid to be run.
     for f in self._forms.values():
       if not f.is_valid():
+        LOG.error(smart_str(f.errors))
         r = False
     return r