Django

Code

Changeset 1477

Show
Ignore:
Timestamp:
11/28/05 08:23:02 (3 years ago)
Author:
adrian
Message:

Fixed #943 -- Restored django-admin createsuperuser functionality with no arguments. Thanks, deric

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/bin/django-admin.py

    r1474 r1477  
    8585            username, email, password = args[1], args[2], args[3] 
    8686        except IndexError: 
    87             sys.stderr.write("Error: %r requires arguments of 'username email password' or no argument at all.\n") 
    88             sys.exit(1) 
    89         ACTION_MAPPING[action](username, email, password) 
     87            if len(args) == 1: # We got no arguments, just the action. 
     88                ACTION_MAPPING[action]() 
     89            else: 
     90                sys.stderr.write("Error: %r requires arguments of 'username email password' or no argument at all.\n") 
     91                sys.exit(1) 
     92        else: 
     93            ACTION_MAPPING[action](username, email, password) 
    9094    elif action in ('init', 'validate'): 
    9195        ACTION_MAPPING[action]()