Opened 6 years ago

Last modified 6 weeks ago

#23521 assigned Bug

removal of concrete Model from bases doesn't remove it from ModelState bases — at Initial Version

Reported by: Sergey Fedoseev Owned by:
Component: Migrations Version: master
Severity: Normal Keywords:
Cc: info+coding@…, bugs@…, ericmills2@…, Charlie Denton, Ian Foote, Daniel Rios, Sardorbek Imomaliev Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


Steps to reproduce:

  • add test app with
    class Thing(models.Model):
    class SuperThing(Thing):
  • do makemigrations test
  • change
    class SuperThing(models.Model):
        thing_ptr = models.AutoField(primary_key=True)
  • do makemigrations test
  • do it one more time makemigrations test

last command results in

django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'test.SuperThing'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 in an app with no migrations; see for more

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top