Skip to content

Commit

Permalink
Runtime: correct module_name for This
Browse files Browse the repository at this point in the history
  • Loading branch information
LifeDJIK committed Nov 27, 2024
1 parent a5d5afa commit ae60caa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pylon/core/tools/module/descriptor.py
Original file line number Diff line number Diff line change
@@ -497,6 +497,7 @@ def init_db(self):
from pylon.framework.db import db_migrations # pylint: disable=C0415
# Step: load models
module_pkg = self.loader.module_name
module_name = module_pkg.split(".")[1]
#
if self.loader.has_directory("db/models"):
for model_resource in importlib.resources.contents(
@@ -520,7 +521,7 @@ def init_db(self):
)
continue
# Step: create entities
module_this = this.for_module(module_pkg)
module_this = this.for_module(module_name)
module_this.db.metadata.create_all(bind=self.context.db.engine)
#
db_namespace_helper = module_this.spaces.get("db_namespace_helper", None)

0 comments on commit ae60caa

Please sign in to comment.