#19401: 'swapped' checking does not account for case insensitivity ----------------------------------------------+------------------------ Reporter: chris@… | Owner: nobody Type: Bug | Status: new Component: Database layer (models, ORM) | Version: 1.5-beta-1 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 ----------------------------------------------+------------------------ According to the code at django/db/models/options.py:230 the test for "has this class been swapped?" is essentially: "if there's a swapped meta option, and the option is not None, and the option isn't simply the name of the current model, in "appname.model" format"
However, the test doesn't take into account that the model part of appname.model is case insensitive. While we could simply normalise app_name and that coming back from the setting, I think a better test would be: "if there's a swapped meta option, and the option is not none, and the "get_model()" using that option is not the same as the current class instance." Ie, rather than assume model names are case insensitive, just use the get_model and ensure it doesn't return us. -- Ticket URL: <https://code.djangoproject.com/ticket/19401> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.