ソースを参照

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

Roland Haroutiounian 9年前
コミット
88d79a0a22
1個のファイルの変更2行の追加1行の削除
  1. 2
    1
      EditorialModel/components.py

+ 2
- 1
EditorialModel/components.py ファイルの表示

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

読み込み中…
キャンセル
保存