From a8e164b45570eafeb8713d1213d5e3fcbd3934fb Mon Sep 17 00:00:00 2001 From: trgiangdo Date: Fri, 10 Nov 2023 16:40:38 +0700 Subject: [PATCH] fix: _get_latest_version() of VersionSQLRepo should return ModelNotFound if not found any version --- src/taipy/core/_version/_version_sql_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/taipy/core/_version/_version_sql_repository.py b/src/taipy/core/_version/_version_sql_repository.py index bff04b428..374b4e3e0 100644 --- a/src/taipy/core/_version/_version_sql_repository.py +++ b/src/taipy/core/_version/_version_sql_repository.py @@ -32,7 +32,7 @@ def _set_latest_version(self, version_number): def _get_latest_version(self): if latest := self.db.query(self.model_type).filter_by(is_latest=True).first(): return latest.id - return "" + raise ModelNotFound(self.model_type, "") def _set_development_version(self, version_number): if old_development := self.db.query(self.model_type).filter_by(is_development=True).first():