Преглед на файлове

HUE-8330 [editor] Fix SQL editor list when all editors are SQL

Romain преди 6 години
родител
ревизия
f7be5a24db
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      desktop/core/src/desktop/models.py

+ 1 - 1
desktop/core/src/desktop/models.py

@@ -1677,7 +1677,7 @@ class ClusterConfig():
       try:
         first_non_sql_index = [interpreter['is_sql'] for interpreter in interpreters].index(False)
       except ValueError:
-        first_non_sql_index = 0
+        first_non_sql_index = len(interpreters) if all([interpreter['is_sql'] for interpreter in interpreters]) else 0
       interpreters.insert(first_non_sql_index, {
         'name': 'notebook',
         'type': 'notebook',