﻿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
26655	Provide a hook to handle database exceptions in Django Admin	Nick Retallack	nobody	"Steps to reproduce:
 * Create a database model with a unique constraint
 * Create a record in the django admin
 * Create another record with the same value in that field.

The result is an unhandled database exception.  It would be better if the exception was handled and reported as an error on the form.  Here is a simple patch that demonstrates how you could do this.

[https://github.com/nickretallack/django/commit/9353970aa0f169e44175a155a4a9e69daf8bda18]

This method could be overridden to attach the error to the form in a more specific way, for example by introspecting the error's diagnostic information from the database to determine what the problem was and which form field it should be attached to."	Bug	closed	contrib.admin	dev	Normal	wontfix			Unreviewed	1	0	0	0	0	0
