diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-11-28 02:57:38 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-11-28 02:57:38 +0000 |
| commit | e85b071e47a8b25d47d7dfbb3b006030a1d09d87 (patch) | |
| tree | 8cc51dd6c16ed835b44643f0ce0035d5e90a466b /django/bin/django-admin.py | |
| parent | 5de6fe1b2d5afb0a210f3aa52fd21ad3e4f8a8f8 (diff) | |
Fixed #798 and #715 -- Added optional arguments to createsuperuser, for each use in shell scripts. Thanks for the patch, bjorn@exoweb.net
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1474 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/bin/django-admin.py')
| -rwxr-xr-x | django/bin/django-admin.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/django/bin/django-admin.py b/django/bin/django-admin.py index e08eeccb70..38c3fe2c83 100755 --- a/django/bin/django-admin.py +++ b/django/bin/django-admin.py @@ -80,7 +80,14 @@ def main(): from django.utils import translation translation.activate('en-us') - if action in ('createsuperuser', 'init', 'validate'): + if action == 'createsuperuser': + try: + username, email, password = args[1], args[2], args[3] + except IndexError: + sys.stderr.write("Error: %r requires arguments of 'username email password' or no argument at all.\n") + sys.exit(1) + ACTION_MAPPING[action](username, email, password) + elif action in ('init', 'validate'): ACTION_MAPPING[action]() elif action == 'inspectdb': try: |
