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
@@ -34,6 +34,7 @@ class StudyStatus(object):
|
||||
self._status = Status.EDIT
|
||||
self._scenario = scenario
|
||||
self._saved = True
|
||||
self._loading = False
|
||||
|
||||
@property
|
||||
def scenario_id(self):
|
||||
@@ -86,6 +87,15 @@ class StudyStatus(object):
|
||||
def is_saved(self):
|
||||
return self._saved
|
||||
|
||||
def is_loading(self):
|
||||
return self._loading
|
||||
|
||||
def start_loading(self):
|
||||
self._loading = True
|
||||
|
||||
def stop_loading(self):
|
||||
self._loading = False
|
||||
|
||||
def save(self):
|
||||
logger.debug("model status set as saved")
|
||||
self._saved = True
|
||||
@@ -97,6 +107,9 @@ class StudyStatus(object):
|
||||
self._saved = True
|
||||
|
||||
def modified(self):
|
||||
if self._loading:
|
||||
return
|
||||
|
||||
if self._saved:
|
||||
self.version += 1
|
||||
|
||||
|
||||
Reference in new issue
Block a user