﻿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
24539	Attempt to create object with repeated value on a custom PK raises IntegrityError on wrong field	Evandro Myller	nobody	"I have this model {{{Product}}}, child of an abstract model which defines a {{{created}}} field with {{{auto_now_add}}} set. All the CRUD works just fine so far.

The problem happens when I add a custom primary key to {{{Product}}}: If I try to '''create''' a {{{Product}}} object '''through the admin''' giving the {{{reference}}} field a repeated value, expecting to see a nice validation error message saying that another object with that reference already exists, I get an {{{IntegrityError}}} stating that the {{{created}}} field cannot be {{{NULL}}} (traceback attached) -- nothing even about the custom primary key.

Note: I noticed the exception is raised from an {{{UPDATE}}} query, which is really odd since I'm posting data from the admin add view."	Bug	new	Uncategorized	1.7	Normal				Unreviewed	0	0	0	0	0	0
