Leaklens

django__django-11066

RenameContentType._rename() doesn't save the content type on the correct database

Verdict: the fix is stated in the issue (Tier A).

Hebert, the solution proposed by Tyler on the PR looks appropriate to me. The using=db kwarg has to be passed to save() for the same reason explained in the SO page you linked to; transaction.atomic(using) doesn't route any query and save(using) skips query routing.

The text states the fix: “content_type.save(update_fields={'model'}) should be content_type.save(using=db, update_fields={'model'})”

All SWE-bench Verified tasks · more django/django tasks · How the check works