﻿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
8245	Exceptions in admin.py can get hidden by an AlreadyRegistered exception	 	nobody	"Consider the following admin.py file:

{{{
#!python
from django.contrib import admin
from testpro.testapp.models import *

admin.site.register(Screenshot)

raise Exception(""Exception that can be much less obvious than this staged one (like a missed import)."")
}}}

It's loaded by admin.autodiscover() in urls.py.

Now start the ''development server'' in ''debug mode'' and access the admin. What happens is this:

 * On the '''first request after starting the dev server''' our test exception is shown as the response.

{{{
ImproperlyConfigured at /admin/
Error while importing URLconf 'testpro.urls': Exception that can be much less obvious than this staged one (like a missed import).
}}}

 * For '''every subsequent request''' this exception is the response:

{{{
ImproperlyConfigured at /admin/
Error while importing URLconf 'testpro.urls': The model Screenshot is already registered
}}}

Needless to say this can be ''really'' frustrating to debug if one does not see the first and correct exception by chance."		closed	contrib.admin	dev		fixed			Accepted	1	0	0	0		
