﻿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
597	django-admin.py createsuperuser (MySQL) broken	stava@…	Adrian Holovaty	"The ""django-admin.py createsuperuser"" using MySQL seems to be broken (recently, in revision 797).


{{{
da createsuperuser
Username (only letters, digits and underscores): stava
E-mail address: stava@jonitec.se
Password: 
Password (again): 
Traceback (most recent call last):
  File ""/usr/bin/da"", line 130, in ?
    main()
  File ""/usr/bin/da"", line 75, in main
    ACTION_MAPPING[action]()
  File ""/usr/lib/python2.3/site-packages/django/core/management.py"", line 444, in createsuperuser
    u = users.create_user(username, email, password)
  File ""/usr/lib/python2.3/site-packages/django/models/auth.py"", line 163, in _module_create_user
    user.save()
  File ""/usr/lib/python2.3/site-packages/django/utils/functional.py"", line 3, in _curried
    return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))
  File ""/usr/lib/python2.3/site-packages/django/core/meta/__init__.py"", line 799, in method_save
    db_values = [f.get_db_prep_save(f.pre_save(getattr(self, f.column), True)) for f in opts.fields if not isinstance(f, AutoField)]
  File ""/usr/lib/python2.3/site-packages/django/core/meta/fields.py"", line 340, in get_db_prep_save
    value = value.replace(microsecond=0)
TypeError: replace() takes no keyword arguments
}}}

Further investigation reveals that the SQL statement is also incorrect:

{{{
INSERT INTO auth_users (date_joined, last_login, is_superuser, is_active,
    is_staff, password_md5, email, last_name, first_name, username)
  VALUES
    (username, , , email, passwd, False, True, False,
     2005-10-07 02:10:25.732343, 2005-10-07 02:10:25.732343)'
}}}

The list of field names and the list of values does not correlate."	defect	closed	contrib.admin		major	worksforme			Unreviewed	0	0	0	0	0	0
