Skip to content
Discussion options

You must be logged in to vote

I know this is quite old but I just tried to do a similar thing with a polymorphic Profile model and a custom user model that inherits from Profile (i.e. the same as described above). After getting the same error and seeing no solution to this issue, I decided to do a little digging.

Turns out, Django doesn't strictly use the models from your models.py files during migrations. I discovered this by placing a print(type(User)) statement in the offending migration file which returned <class '__fake__.User'>. Therefore the fake model did not use the polymorphic metaclass and therefore did not have the required attribute above.

Thankfully, there is a quick and easy fix for this issue: in you c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bckohan
Comment options

Answer selected by bckohan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #397 on January 07, 2026 21:10.