﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26412	createsupseruser with email login instead of username	Adam	nobody	"I have a project that uses email for user authentication and we do not use username at all and I have a custom user model based on `AbstractBaseUser`.

When running `./manage.py createsupseruser` it prompts correctly for just email and password (in response to `REQUIRED_FIELDS` being set correctly). However, when trying to create the superuser it spits out `TypeError: create_superuser() missing 1 required positional argument: 'username'` in line 75 of `/contrib/auth/management/commands/createsuperuser.py`.

The error happens because in `contrib/auth/models` in the `create_superuser` and `create_user` function it's requiring username and email to be passed in but the createsuperuser command is only passing in email because username is not in the `REQUIRED_FIELDS`.

This seems like a bug in Django to me. Would this be open to a pull request? There are 2 ways I see to fix this, and am very open to recommendation if this is in deed a bug and open to a pull request.

#1 default username and email to None in the manager functions
#2 if email or username are not defined in `user_data` in createsuperuser.py, add those to the dict as `None` before passing to the create_superuser function.

I am seeing this in django 1.9.4 and have also seen it in previous versions of django"	Bug	closed	Core (Management commands)	1.9	Normal	invalid			Unreviewed	0	0	0	0	0	0
