Prechádzať zdrojové kódy

HUE-8330 [core] Typo in main Hue template

Romain Rigaux 7 rokov pred
rodič
commit
3f2dea176a

+ 4 - 8
desktop/core/src/desktop/models.py

@@ -1901,14 +1901,10 @@ class Cluster():
 
   def __init__(self, user):
     self.user = user
-    self.data = {}
-
-    if IS_EMBEDDED.get(): # ANALYTIC_DB
-      self.data = get_clusters()['Default']
-    elif self.default_cluster:
-      clusters = get_clusters()
-      cluster_name = json.loads(self.default_cluster[USER_PREFERENCE_CLUSTER]).get('name')
-      self.data = cluster_name and clusters.get(cluster_name) and clusters[cluster_name] or None
+    self.data = get_clusters()['Default']
+
+  def get_type(self):
+    return self.data['type']
 
 
 def _get_apps(user, section=None):

+ 1 - 0
desktop/core/src/desktop/templates/hue.mako

@@ -1551,6 +1551,7 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
         huePubSub.subscribe('hue.new.default.app', function () {
           huePubSub.publish('cluster.config.refresh.config');
         });
+      }
 
       var topNavViewModel = new TopNavViewModel(onePageViewModel);
       % if not IS_EMBEDDED.get():