Results: Fix river loading reachs creation.

This commit is contained in:
parouby committed 2026-09-23 14:27:59 +02:00
1 parent 4a6349cd9c
commit 5e3e5628d2
1 file changed
+3 -2
+3 -2
View File
@@ -393,7 +393,7 @@ class Reach(SQLSubModel):
class River(SQLSubModel):
_sub_classes = [Reach]
def __init__(self, study, parent):
def __init__(self, study, parent, init=True):
super(River, self).__init__(
id=-1, status=study.status,
owner_scenario=study.status.scenario.id
@@ -404,6 +404,7 @@ class River(SQLSubModel):
# Dict with timestamps as key
self._reachs = []
if init:
for i, _ in enumerate(self._study.river.enable_edges()):
self.add(i)
@@ -458,7 +459,7 @@ class River(SQLSubModel):
study = data["study"]
parent = data["parent"]
new_river = cls(study, parent)
new_river = cls(study, parent, init=False)
for reach in study.river.reachs():
data["reach"] = reach.reach