mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Scenarios: Fix scenarios table list after delete action.
This commit is contained in:
1 parent
d62e703439
commit
e6d3564d9b
2 files changed
+22
-7
No files matched your search
@@ -60,6 +60,9 @@ class Scenarios(PamhyrModelDict):
|
||||
self.set(new._id, new)
|
||||
return new
|
||||
|
||||
def __len__(self):
|
||||
return len(self.lst)
|
||||
|
||||
@property
|
||||
def lst(self):
|
||||
return list(
|
||||
@@ -70,8 +73,8 @@ class Scenarios(PamhyrModelDict):
|
||||
)
|
||||
|
||||
def delete(self, key):
|
||||
el = self._dict.get(key)
|
||||
if el is None:
|
||||
if key not in self._dict:
|
||||
return
|
||||
|
||||
el.set_as_deleted()
|
||||
self._dict[key].set_as_deleted()
|
||||
self._status.modified()
|
||||
Reference in new issue
Block a user