mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Scenario: avoid marking loaded scenario data as modified, that created unwanted copies in database
This commit is contained in:
1 parent
0c7ede5f43
commit
a2461af084
3 files changed
+28
-7
No files matched your search
+11
-7
@@ -572,16 +572,20 @@ class Study(SQLModel):
|
||||
"scenario": scenario
|
||||
}
|
||||
|
||||
# Load river data
|
||||
river = River._db_load(
|
||||
sql_exec, data=data
|
||||
)
|
||||
data["study"] = self
|
||||
river._db_load_results(sql_exec, data=data)
|
||||
self.status.start_loading()
|
||||
try:
|
||||
# Load river data
|
||||
river = River._db_load(
|
||||
sql_exec, data=data
|
||||
)
|
||||
data["study"] = self
|
||||
river._db_load_results(sql_exec, data=data)
|
||||
finally:
|
||||
self.status.stop_loading()
|
||||
self.status.scenario = old_scenario
|
||||
|
||||
# FIXME: Disable scenario cache to save memory usage
|
||||
# self._river_scenario_cache[scenario] = river
|
||||
self.status.scenario = old_scenario
|
||||
|
||||
return river
|
||||
|
||||
|
||||
Reference in new issue
Block a user