mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-29 19:10:42 +01:00
Results: Fix river loading reachs creation.
This commit is contained in:
1 parent
4a6349cd9c
commit
5e3e5628d2
1 file changed
+3
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user