mirror of
https://github.com/yweber/lodel2.git
synced 2026-07-01 13:20:48 +02:00
[#44] EmType : Added a check method and its call in the delete process
This commit is contained in:
parent
b668556c3f
commit
083daf67db
1 changed files with 10 additions and 1 deletions
|
|
@ -53,6 +53,12 @@ class EmType(EmComponent):
|
|||
def create(cls, name, em_class, sortcolumn='rank', **em_component_args):
|
||||
return super(EmType, cls).create(name=name, class_id=em_class.uid, sortcolumn=sortcolumn, **em_component_args)
|
||||
|
||||
## Checks if the EmType is valid
|
||||
# @return Bool : True if valid, False if not
|
||||
def check(self):
|
||||
super(EmType, self).check()
|
||||
return True
|
||||
|
||||
@property
|
||||
## Return the EmClassType of the type
|
||||
# @return EditorialModel.classtypes.*
|
||||
|
|
@ -79,7 +85,10 @@ class EmType(EmComponent):
|
|||
for nature, sups in self.superiors().items():
|
||||
for sup in sups:
|
||||
self.del_superior(sup, nature)
|
||||
return super(EmType, self).delete()
|
||||
if super(EmType, self).delete():
|
||||
return self.check()
|
||||
else:
|
||||
return False
|
||||
|
||||
## Get the list of non empty associated fieldgroups
|
||||
# @return A list of EmFieldGroup instance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue