Opened 18 years ago

Closed 18 years ago

#597 closed defect (worksforme) createsuperuser (MySQL) broken

Reported by: stava@… Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The " createsuperuser" using MySQL seems to be broken (recently, in revision 797).

da createsuperuser
Username (only letters, digits and underscores): stava
E-mail address:
Password (again): 
Traceback (most recent call last):
  File "/usr/bin/da", line 130, in ?
  File "/usr/bin/da", line 75, in main
  File "/usr/lib/python2.3/site-packages/django/core/", line 444, in createsuperuser
    u = users.create_user(username, email, password)
  File "/usr/lib/python2.3/site-packages/django/models/", line 163, in _module_create_user
  File "/usr/lib/python2.3/site-packages/django/utils/", 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/", 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/", 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)
    (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.

Change History (2)

comment:1 Changed 18 years ago by Sune Kirkeby <sune.kirkeby@…>

Ok, I just tested, and it works here (rev. 851).

sune@moria ~/svk/django/trunk $ init
sune@moria ~/svk/django/trunk $ createsuperuser
Username (only letters, digits and underscores): sune
E-mail address:
Password (again): 
User created successfully.

And, where did you grap that SQL? It's all kinds of botched...

comment:2 Changed 18 years ago by Adrian Holovaty

Resolution: worksforme
Status: newclosed

Works here, too. I'm closing the ticket.

Note: See TracTickets for help on using tickets.
Back to Top