8000 [soc2010/app-loading] ignore the classname of custom apps when execut… · alex-python/django@9cf522e · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cf522e

Browse files
committed
[soc2010/app-loading] ignore the classname of custom apps when executing management commands
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13569 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 9f8478f commit 9cf522e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

django/utils/translation/trans_real.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,13 @@ def _merge(path):
156156
res = _merge(localepath)
157157

158158
for appname in settings.INSTALLED_APPS:
159-
app = import_module(appname)
159+
try:
160+
app = import_module(appname)
161+
except ImportError:
162+
if not '.' in appname:
163+
raise
164+
appname, app_classname = appname.rsplit('.', 1)
165+
app = import_module(appname)
160166
apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
161167

162168
if os.path.isdir(apppath):

0 commit comments

Comments
 (0)
0