fix a problem that masks errors in settings files for some users - in those cases you only got "INSTALLED_APPS not defined", but in reality your settings file was broken.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Georg Bauer 2005-11-11 23:34:08 +00:00
parent 1873c95b31
commit 6004fe9573
1 changed files with 8 additions and 8 deletions

View File

@ -3,14 +3,6 @@ from django.core import management
from optparse import OptionParser
import os, sys
# switch to english, because django-admin creates database content
# like permissions, and those shouldn't contain any translations
try:
from django.utils import translation
translation.activate('en-us')
except:
pass
ACTION_MAPPING = {
'adminindex': management.get_admin_index,
'createsuperuser': management.createsuperuser,
@ -80,6 +72,14 @@ def main():
parser.print_usage_and_exit()
if not ACTION_MAPPING.has_key(action):
print_error("Your action, %r, was invalid." % action, sys.argv[0])
# switch to english, because django-admin creates database content
# like permissions, and those shouldn't contain any translations.
# But only do this if we should have a working settings file.
if action not in ('startproject', 'startapp'):
from django.utils import translation
translation.activate('en-us')
if action in ('createsuperuser', 'init', 'validate'):
ACTION_MAPPING[action]()
elif action == 'inspectdb':