Commits

Luke Plant committed 1b87456

Fixed bug in MultiSelectField

  • Participants
  • Parent commits b111cad

Comments (0)

Files changed (2)

File semanticeditor/fields.py

     def to_python(self, value):
         if isinstance(value, list):
             return value
-        elif value==None:
-            return ''
+        elif value == None or value == u"":
+            return []
         return value.split(",")
 
     def contribute_to_class(self, cls, name):

File semanticeditor/models.py

     classes = CssClass.objects.all().order_by('category__name', 'verbose_name')
     # the class is allowed in the template if explicitly mentioned, or if no templates
     # are specified - useful, because many classes will be used across all templates  
-    return [c for c in classes if c.templates == [u''] or template in c.templates]
+    return [c for c in classes if c.templates == [] or template in c.templates]