﻿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
19745	Wrong prompt for `createuser` management command (<django.utils.functional.__proxy__ object at ...>)	Baptiste Mispelon	nobody	"Using a fresh checkout, I created a new project, using all the default settings (except for DATABASES).

When running `syncdb` for the first time (or running `createsuperuser` anytime), the prompts are wrong.

Here's what it looks like with python 2.7:

{{{
$ python manage.py createsuperuser
<django.utils.functional.__proxy__ object at 0x7fe4c341a850> (leave blank to use 'bmispelon'): newuser
<django.utils.functional.__proxy__ object at 0x29d8c10>: foo@example.com
Password: 
Password (again): 
Superuser created successfully.


$ python manage.py createsuperuser
<django.utils.functional.__proxy__ object at 0x7f7717aed850> (leave blank to use 'bmispelon'): newuser
Error: That <django.utils.functional.__proxy__ object at 0x1d45ad0> is already taken.
<django.utils.functional.__proxy__ object at 0x7f7717aed850> (leave blank to use 'bmispelon'): ^C
Operation cancelled.
}}}

By comparison, here is what it looks like using python 3.2 (correct output):

{{{
$ python3 manage.py createsuperuser
Username (leave blank to use 'bmispelon'): newuser2
Email address: foo@example.com
Password: 
Password (again): 
Superuser created successfully.


$ python3 manage.py createsuperuser
Username (leave blank to use 'bmispelon'): newuser2
Error: That username is already taken.
Username (leave blank to use 'bmispelon'): ^C
Operation cancelled.
}}}


There are three issues here:

1) The name of the username field is displayed wrong
2) The name of the email field is displayed wrong
3) The error message when using an existing username is wrong.


The code in question is located in `django/contrib/auth/management/commands/createsuperuser.py`.
The first two were introduced by commit 55c585f1c7a9c91308193f0648caf36203174564 while the third one was introduced with an older one: b3b3db3d954a5226f870a0b4403343c78efae8dc


The issue can be fixed by wrapping the strings being formatted with six.u, like so:
{{{
from django.utils.six import u
# ...
input_msg = u(""%s (leave blank to use '%s')"") % (input_msg, default_username) # L87
}}}

However, I'm not sure of the implications of such a fix."	Bug	closed	contrib.auth	1.5-beta-1	Release blocker	fixed	createuser repr py3		Ready for checkin	1	0	1	0	0	0
