Skip to content

Commit

Permalink
Allow get_class from apps.AppConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
BoPeng committed Dec 3, 2022
1 parent d5d8ea1 commit 5406c65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions machina/core/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,7 @@ def _get_app_module_path(module_label):
for app in settings.INSTALLED_APPS:
if app.endswith('.' + app_name) or app == app_name:
return app
path = app.split('.')
if len(path) >= 3 and path[-2] == 'apps' and path[-3] == app_name:
return app
return None

0 comments on commit 5406c65

Please sign in to comment.