Ticket #22525: first_letter.diff

File first_letter.diff, 819 bytes (added by Gumnos, 11 years ago)

A patch to relax the typing requirements for adding a user via syncdb

  • django/contrib/auth/management/__init__.py

    diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py
    index 029b4bb..5f75907 100644
    a b def create_superuser(app_config, verbosity=2, interactive=True, using=DEFAULT_DB  
    135135            "now? (yes/no): ")
    136136        confirm = input(msg)
    137137        while 1:
    138             if confirm not in ('yes', 'no'):
     138            first_letter = confirm[:1]
     139            if first_letter not in ('y', 'n'):
    139140                confirm = input('Please enter either "yes" or "no": ')
    140141                continue
    141             if confirm == 'yes':
     142            if first_letter == 'y':
    142143                call_command("createsuperuser", interactive=True, database=using)
    143144            break
    144145
Back to Top