#36660 closed Bug (fixed)
False-positive E012 check error when index contains descending order field
| Reported by: | Federico Bond | Owned by: | Simon Charette |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 6.0 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Federico Bond | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When a model has an index defined like this:
class Meta:
indexes = [models.Index(fields=["foo", "-bar"])]
The system check framework in 6.0a1 will now report the following error:
foo.FooModel: (models.E012) 'indexes' refers to the nonexistent field '-bar'.
Tested with Django 6.0a1. This was not happening in 5.2. Might have something to do with these changes but I'm not sure.
Change History (5)
comment:1 by , 4 weeks ago
| Owner: | set to |
|---|---|
| Severity: | Normal → Release blocker |
| Status: | new → assigned |
| Triage Stage: | Unreviewed → Accepted |
comment:3 by , 4 weeks ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
Thank you for the report!
Confirmed to be a regression caused by 8638d8bf74c1a58302c97d4436ad2eb08438145b's (#36273) lack of
fields_ordersusage (before and after) when calling_check_local_fields.