mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
pamhyr: Fix save after backup and minor change.
This commit is contained in:
1 parent
48e30125bb
commit
1ff895368e
3 files changed
+22
-6
No files matched your search
+3
-2
@@ -103,15 +103,16 @@ class Study(SQLModel):
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
|
||||
is_new = False
|
||||
fname = fname + "." + str(self._old_save_id)
|
||||
if os.path.exists(self.filename) and ".backup" not in self.filename:
|
||||
filename = os.path.join(fdir, "_PAMHYR_", "__old__", fname)
|
||||
logger.debug(f"Backup previous version copy: {filename}")
|
||||
shutil.copy(self.filename, filename)
|
||||
self._old_save_id += 1
|
||||
else:
|
||||
self._init_db_file(self.filename, is_new=True)
|
||||
is_new = True
|
||||
|
||||
self._init_db_file(self.filename, is_new=is_new)
|
||||
self.commit()
|
||||
|
||||
# Save
|
||||
|
||||
Reference in new issue
Block a user