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 23687 Prevent `ContentType.objects.get_for_model` from creating objects for deferred, auto_created and swapped models ILYA nobody "This ticket is extracted from #23444 for the sake of clarity. See initial discussion there. Briefly: `ContentType.objects.get_for_model` method returns appropriate `ContentType` object for the model if it exsits and creates one if not. But it doesn't check whether a model passed to it is deferred, auto_created or swapped. Thus we get unnecessary `ContentType` objects in our DB that will be removed after next sync_db/migrate as django by default considers such CT objects as stale (and doesn't create them by itself anyway)." Cleanup/optimization new contrib.contenttypes dev Normal Accepted 0 0 0 0 0 0