[Bug] manage.py createsuperuser does not work #92147

Open
opened 2021-10-12 15:57:10 +02:00 by Anna Sirota · 1 comment
Owner

Fails with

Traceback (most recent call last):
  File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute
    return self.cursor.execute(sql, params)
  File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 74, in execute
    return self.cursor.execute(query, args)
  File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/MySQLdb/connections.py", line 226, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.IntegrityError: (1062, "Duplicate entry '' for key 'bid_main_user_nickname_9115271c_uniq'")

The above exception was the direct cause of the following exception:

because it's impossible to supply a nickname via DJANGO_SUPERUSER_<field>, even though User.nickname cannot be blank and must be unique and still not included into REQUIRED_FIELDS.

Fails with ``` Traceback (most recent call last): File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute return self.cursor.execute(sql, params) File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 74, in execute return self.cursor.execute(query, args) File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/MySQLdb/cursors.py", line 209, in execute res = self._query(query) File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/MySQLdb/cursors.py", line 315, in _query db.query(q) File "/home/railla/.envs/blender-id/lib/python3.9/site-packages/MySQLdb/connections.py", line 226, in query _mysql.connection.query(self, query) MySQLdb._exceptions.IntegrityError: (1062, "Duplicate entry '' for key 'bid_main_user_nickname_9115271c_uniq'") The above exception was the direct cause of the following exception: ``` because it's impossible to supply a `nickname` via `DJANGO_SUPERUSER_<field>`, even though `User.nickname` cannot be blank and must be unique and still not included into `REQUIRED_FIELDS`.
Author
Owner

Added subscriber: @railla

Added subscriber: @railla
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/blender-id#92147
No description provided.