Browse Source

[#44] EmType : Added a check method and its call in the delete process

Roland Haroutiounian 9 years ago
parent
commit
083daf67db
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      EditorialModel/types.py

+ 10
- 1
EditorialModel/types.py View File

@@ -53,6 +53,12 @@ class EmType(EmComponent):
53 53
     def create(cls, name, em_class, sortcolumn='rank', **em_component_args):
54 54
         return super(EmType, cls).create(name=name, class_id=em_class.uid, sortcolumn=sortcolumn, **em_component_args)
55 55
 
56
+    ## Checks if the EmType is valid
57
+    # @return Bool : True if valid, False if not
58
+    def check(self):
59
+        super(EmType, self).check()
60
+        return True
61
+
56 62
     @property
57 63
     ## Return the EmClassType of the type
58 64
     # @return EditorialModel.classtypes.*
@@ -79,7 +85,10 @@ class EmType(EmComponent):
79 85
         for nature, sups in self.superiors().items():
80 86
             for sup in sups:
81 87
                 self.del_superior(sup, nature)
82
-        return super(EmType, self).delete()
88
+        if super(EmType, self).delete():
89
+            return self.check()
90
+        else:
91
+            return False
83 92
 
84 93
     ## Get the list of non empty associated fieldgroups
85 94
     # @return A list of EmFieldGroup instance

Loading…
Cancel
Save