Scenario: Remove posibility to remove non leaf scenario.

This commit is contained in:
parouby committed 2026-05-22 09:21:55 +02:00
1 parent d922436ada
commit 5d8ec51417
2 files changed
+16 -1

No files matched your search

+11
View File
@@ -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
)