Explorar el Código

[search] Do not try to convert empty collections

Romain Rigaux hace 11 años
padre
commit
a661e8f
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  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):