Merge pull request #3115 from sergevanginderachter/groupdepth
optimization when adding child groupspull/4420/head
commit
0b6570eef8
|
@ -35,6 +35,9 @@ class Group(object):
|
|||
|
||||
if self == group:
|
||||
raise Exception("can't add group to itself")
|
||||
|
||||
# don't add if it's already there
|
||||
if not group in self.child_groups:
|
||||
self.child_groups.append(group)
|
||||
group.depth = max([self.depth+1, group.depth])
|
||||
group.parent_groups.append(self)
|
||||
|
|
Loading…
Reference in New Issue