Pārlūkot izejas kodu

[beeswax] Saved query are renamed to None

Romain Rigaux 12 gadi atpakaļ
vecāks
revīzija
3f800fdf2f

+ 1 - 1
apps/beeswax/src/beeswax/server/dbms.py

@@ -30,7 +30,7 @@ from filebrowser.views import location_to_url
 
 from beeswax import hive_site
 from beeswax.conf import BEESWAX_SERVER_HOST, BEESWAX_SERVER_PORT,\
-  BROWSE_PARTITIONED_TABLE_LIMIT
+  BROWSE_PARTITIONED_TABLE_LIMIT, SERVER_INTERFACE
 from beeswax.design import hql_query
 from beeswax.models import QueryHistory, HIVE_SERVER2
 from desktop.lib.django_util import format_preserving_redirect

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

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

+ 1 - 0
apps/beeswax/src/beeswax/tests.py

@@ -610,6 +610,7 @@ for x in sys.stdin:
 
     # Retrieve that design and check correct DB is selected
     design = beeswax.models.SavedQuery.objects.filter(name='rubbish')[0]
+    assert_equal('', design.desc)
     resp = cli.get('/beeswax/execute/%s' % (design.id,))
     assert_true('selected="selected">other_db</option>' in resp.content)
     assert_similar_pages(resp.content, exe_resp.content)