Browse Source

[#44] EmClass: added the call to the check method in the delete process

Roland Haroutiounian 9 years ago
parent
commit
77f91bc68b
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      EditorialModel/classes.py

+ 6
- 2
EditorialModel/classes.py View File

@@ -7,6 +7,7 @@ from EditorialModel.components import EmComponent
7 7
 import EditorialModel.fieldtypes as ftypes
8 8
 import EditorialModel
9 9
 
10
+
10 11
 ## @brief Manipulate Classes of the Editorial Model
11 12
 # Create classes of object.
12 13
 # @see EmClass, EmType, EditorialModel.fieldgroups.EmFieldGroup, EmField
@@ -28,7 +29,6 @@ class EmClass(EmComponent):
28 29
     def check(self):
29 30
         super(EmClass, self).check()
30 31
         return True
31
-        
32 32
 
33 33
     ## @brief Delete a class if it's ''empty''
34 34
     # If a class has no fieldgroups delete it
@@ -40,7 +40,11 @@ class EmClass(EmComponent):
40 40
         for fieldgroup in self.model.components(EditorialModel.fieldgroups.EmFieldGroup):
41 41
             if fieldgroup.class_id == self.uid:
42 42
                 return False
43
-        return True
43
+
44
+        if self.model.delete_component(self.uid):
45
+            return self.check()
46
+        else:
47
+            return False
44 48
 
45 49
     ## Retrieve list of the field_groups of this class
46 50
     # @return A list of fieldgroups instance

Loading…
Cancel
Save