Skip to content

Commit

Permalink
اصلاح دالة الحفظ في نموذج قواعد البيانات
Browse files Browse the repository at this point in the history
  • Loading branch information
vzool committed Nov 4, 2024
1 parent 9cc5d69 commit f0fcfda
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zakat/zakat_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2303,11 +2303,13 @@ def __init__(self, **db_params):
self._base_path = None
self._vault_path = None
self._config_path = None
self._db_path = None
self.debug = False
self.raw_sql = True

if str.lower(db_params['provider']) == 'sqlite' and 'filename' in db_params:
db_params['filename'] = str(self.path(db_params['filename']))
self._db_path = db_params['filename']
self._config_path = str(self._base_path / 'config.db')
else:
self._config_path = str(self.path('config.db'))
Expand Down Expand Up @@ -2798,8 +2800,8 @@ def save(self, path: str = None) -> bool:
if path is None:
path = self.path()
db.commit()
if path != self.path():
shutil.copy(self.path(), path)
if path != self._db_path and self._db_path:
shutil.copy(self._db_path, path)
return True

def load(self, path: str = None) -> bool:
Expand Down

0 comments on commit f0fcfda

Please sign in to comment.