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

[search] Do not try to convert empty collections

Romain Rigaux преди 11 години
родител
ревизия
a661e8f
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      apps/search/src/search/models.py

+ 3 - 2
apps/search/src/search/models.py

@@ -315,8 +315,9 @@ class Collection(models.Model):
     if 'autocomplete' not in properties_python:
       properties_python['autocomplete'] = False
     # TODO: Should convert old Hue 3.5 format here
-    if 'showFieldList' not in properties_python['collection']['template']:
-      properties_python['collection']['template']['showFieldList'] = True
+    if 'collection' in properties_python:
+      if 'showFieldList' not in properties_python['collection']['template']:
+        properties_python['collection']['template']['showFieldList'] = True
     return properties_python
 
   def update_properties(self, post_data):