From 133839b0337177816fc40c9a9abd4151f51b6030 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 28 Nov 2005 14:23:02 +0000 Subject: [PATCH] Fixed #943 -- Restored django-admin createsuperuser functionality with no arguments. Thanks, deric git-svn-id: http://code.djangoproject.com/svn/django/trunk@1477 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/bin/django-admin.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/django/bin/django-admin.py b/django/bin/django-admin.py index 38c3fe2c83..a30b038547 100755 --- a/django/bin/django-admin.py +++ b/django/bin/django-admin.py @@ -84,9 +84,13 @@ def main(): 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) + if len(args) == 1: # We got no arguments, just the action. + ACTION_MAPPING[action]() + else: + sys.stderr.write("Error: %r requires arguments of 'username email password' or no argument at all.\n") + sys.exit(1) + else: + ACTION_MAPPING[action](username, email, password) elif action in ('init', 'validate'): ACTION_MAPPING[action]() elif action == 'inspectdb':