Code

Opened 5 years ago

Closed 5 years ago

#9417 closed (duplicate)

Unhelpful admin.py error message

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

Description

If you make a boneheaded move such as creating a ModelAdmin class for a model that you forgot to include in your admin.py's model import statement, you get an error. But it's not the error you might expect. What happens is you get the "model already registered exception", citing the first model registered using admin.site.register().

I spent awhile looking around my app trying to see if I had indeed registered the model in question more than once via imports, but couldn't find it. When I fixed my error in the import statement, everything was fine.

So definitely user error. But the error message Django displayed didn't help guide me to the problem.

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

That's pretty much the same symptomatic issue as in #8245.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.