feat: add rbac-backed settings modules
This commit is contained in:
@@ -61,9 +61,19 @@ def _register_from_package(
|
||||
|
||||
pkg_dir = str(Path(pkg.__file__ or "").parent)
|
||||
|
||||
for _, module_name, _ in pkgutil.iter_modules([pkg_dir]):
|
||||
for _, module_name, is_pkg in pkgutil.iter_modules([pkg_dir]):
|
||||
if module_name.startswith("_"):
|
||||
continue
|
||||
|
||||
if is_pkg:
|
||||
try:
|
||||
sub_pkg_name = f"{pkg_name}.{module_name}"
|
||||
sub_pkg = importlib.import_module(sub_pkg_name)
|
||||
_register_from_package(sub_pkg, sub_pkg_name, package_routers, app)
|
||||
except ImportError:
|
||||
continue
|
||||
continue
|
||||
|
||||
try:
|
||||
mod = importlib.import_module(f"{pkg_name}.{module_name}")
|
||||
except ImportError:
|
||||
|
||||
Reference in New Issue
Block a user