django-polymorphic icon indicating copy to clipboard operation
django-polymorphic copied to clipboard

Forbidden response when existing data with no corresponding `PolymorphicChildModelAdmin`.

Open mrmachine opened this issue 10 years ago • 4 comments

I have some existing data for a polymorphic model, Event, that was created at a time when Event itself was registered as a child model. So polymorphic_ctype points to the Event content type. Subsequently, several child models were added for events, and the parent model is no longer registered as a child model. When I view the events change list I see all the existing data, but when I click through to one of them I get a 403 forbidden response.

Is there a better way to handle this? It was a bit confusing, and I had to dig into the code to figure out what was causing it. Maybe a 500 error would be more appropriate? I assume this is a condition that will require a data migration to fix, by either deleting the offending objects or converting them to another type?

mrmachine avatar Aug 13 '15 00:08 mrmachine