Remove repetitive guarding against double quoting database identifiers
|Database layer (models, ORM)
|Patch needs improvement:
All built-in database backends define a
quote_name() function. In all cases, the function first checks if the string argument is already quoted.
IMO, this looks a bit like "just in case" style programming and a bit of a code smell. Ideally, the calling code should not be passing quoted names in the first place. The Django logic should be such that names are quoted exactly once and not multiple time. I believe if names are quoted twice, it should be treated as a bug in the calling code, not a bug in the
After testing, these guards are unnecessary and all tests pass without it across multiple database backends.
Removing the guard means it won't need to be checked every time SQL names are quoted.
PR to follow.