Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30985 closed Bug (worksforme)

Error when adding a group in admin - "The database backend does not accept 0 as a value for AutoField".

Reported by: Juan Manuel Crescente Owned by: nobody
Component: contrib.admin Version: 2.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

ValueError at /admin/auth/group/add/

The database backend does not accept 0 as a value for AutoField.
Request Method: POST
Request URL: http://localhost:8000/admin/auth/group/add/?_to_field=id&_popup=1
Django Version: 2.2.3
Exception Type: ValueError
Exception Value:
The database backend does not accept 0 as a value for AutoField.
Exception Location: /Users/juan/Documents/manu/dev/yas/venv3/lib/python3.7/site-packages/django/db/backends/mysql/operations.py in validate_autopk_value, line 181
Python Executable: /Users/juan/Documents/manu/dev/yas/venv3/bin/python
Python Version: 3.7.3
Python Path:
['/Users/juan/Documents/manu/dev/yas',

'/Users/juan/Documents/manu/dev/yas/venv3/lib/python37.zip',
'/Users/juan/Documents/manu/dev/yas/venv3/lib/python3.7',
'/Users/juan/Documents/manu/dev/yas/venv3/lib/python3.7/lib-dynload',
'/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7',
'/Users/juan/Documents/manu/dev/yas/venv3/lib/python3.7/site-packages']

Server time: Wed, 13 Nov 2019 19:12:05 +0000

in Django==2.2.3

Change History (2)

comment:1 by Mariusz Felisiak, 5 years ago

Component: Uncategorizedcontrib.admin
Resolution: worksforme
Status: newclosed
Type: UncategorizedBug

Thanks for this report, however described scenario works for me on MySQL.

comment:2 by Mariusz Felisiak, 5 years ago

Summary: Error when adding a group In admin - The database backend does not accept 0 as a value for AutoField.Error when adding a group in admin - "The database backend does not accept 0 as a value for AutoField".
Note: See TracTickets for help on using tickets.
Back to Top