Browse Source

[#49] added an existence test for the "model" property in EmComponent.dumps()

Roland Haroutiounian 9 years ago
parent
commit
88d79a0a22
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      EditorialModel/components.py

+ 2
- 1
EditorialModel/components.py View File

75
     def dumps(self):
75
     def dumps(self):
76
         #attr =  {fname: fval for fname, fval in self.__dict__.items() if not (fname.startswith('_'))}
76
         #attr =  {fname: fval for fname, fval in self.__dict__.items() if not (fname.startswith('_'))}
77
         attr = self.attr_dump
77
         attr = self.attr_dump
78
-        del(attr['model'])
78
+        if 'model' in attr:
79
+            del(attr['model'])
79
         for attr_f in attr:
80
         for attr_f in attr:
80
             if isinstance(attr[attr_f], EmComponent):
81
             if isinstance(attr[attr_f], EmComponent):
81
                 attr[attr_f] = attr[attr_f].uid
82
                 attr[attr_f] = attr[attr_f].uid

Loading…
Cancel
Save