Skip to content

Commit ae60caa

Browse files
committed
Runtime: correct module_name for This
1 parent a5d5afa commit ae60caa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pylon/core/tools/module/descriptor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ def init_db(self):
497497
from pylon.framework.db import db_migrations # pylint: disable=C0415
498498
# Step: load models
499499
module_pkg = self.loader.module_name
500+
module_name = module_pkg.split(".")[1]
500501
#
501502
if self.loader.has_directory("db/models"):
502503
for model_resource in importlib.resources.contents(
@@ -520,7 +521,7 @@ def init_db(self):
520521
)
521522
continue
522523
# Step: create entities
523-
module_this = this.for_module(module_pkg)
524+
module_this = this.for_module(module_name)
524525
module_this.db.metadata.create_all(bind=self.context.db.engine)
525526
#
526527
db_namespace_helper = module_this.spaces.get("db_namespace_helper", None)

0 commit comments

Comments
 (0)