mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Scenario: Remove posibility to remove non leaf scenario.
This commit is contained in:
1 parent
d922436ada
commit
5d8ec51417
2 files changed
+16
-1
No files matched your search
@@ -16,6 +16,8 @@
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from functools import reduce
|
||||
|
||||
from tools import logger_exception
|
||||
|
||||
from Model.Tools.PamhyrDict import PamhyrModelDict
|
||||
@@ -78,3 +80,12 @@ class Scenarios(PamhyrModelDict):
|
||||
|
||||
self._dict[key].set_as_deleted()
|
||||
self._status.modified()
|
||||
|
||||
def is_leaf(self, scenario):
|
||||
return not reduce(
|
||||
lambda acc, s: (
|
||||
acc or s.parent is scenario
|
||||
),
|
||||
self._dict.values(),
|
||||
False
|
||||
)
|
||||
Reference in new issue
Block a user