﻿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
30640	createsuperuser crashes when a custom user model contains required fields that overlap with default command options.	Hasan Ramezani	Hasan Ramezani	"If we have a `User` model like this:
 
{{{
class User(AbstractUser):
    database = models.CharField(max_length=20)
  
    REQUIRED_FIELDS = ['database']
}}}

When we run `python manage.py createsuperuser`,  we will get this error:
`argparse.ArgumentError: argument --database: conflicting option string: --database`.

Because of `createsuperuser` adds a `--database` option by default and also `database` is a required field of `User` model and command tries to add `--database` again.

Possible solution: add a prefix to fields which already added by `createsupperuser`.

"	Bug	closed	contrib.auth	dev	Normal	wontfix			Unreviewed	0	0	0	0	0	0
