Ticket #33122: createsuperuser-username_field.patch

File createsuperuser-username_field.patch, 841 bytes (added by Raymond Olavides, 3 years ago)

patch to add the username positional parameter

  • django/contrib/auth/management/commands/createsuperuser.py

    diff --git a/django/contrib/auth/management/commands/createsuperuser.py b/django/contrib/auth/management/commands/createsuperuser.py
    index 3eb8abff06..2fba26b6aa 100644
    a b class Command(BaseCommand):  
    186186                    field = self.UserModel._meta.get_field(field_name)
    187187                    user_data[field_name] = field.clean(value, None)
    188188
    189             self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
     189            self.UserModel._default_manager.db_manager(database).create_superuser(username, **user_data)
    190190            if options['verbosity'] >= 1:
    191191                self.stdout.write("Superuser created successfully.")
    192192        except KeyboardInterrupt:
Back to Top