﻿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
32494	Admin's raw_id_field check admin.E002 doesn't catch .attname mis-references	Simon Charette	Hasan Ramezani	"Since `admin.E002` relies on `models.Options.get_field` which allows retrieval of fields by both `name` and `attname` referring to fields by `attname` while only `name` [https://github.com/django/django/blob/73b1b225ce1a3318d4478f90cc0db0a260aba3aa/django/contrib/admin/options.py#L163 is taken into consideration] allows the check to pass while `raw_id_fields` is not honoured.

e.g.

{{{#!python
class BookAdmin(ModelAdmin):
    raw_id_fields = ['author_id']
}}}

passes `admin.E002` but the `author` field won't use the ''raw_id'' feature.

The `_check_raw_id_fields_item` method should also make sure to check `field.name == field_name` on field retrieval success and `return refer_to_missing_field(field=field_name, option=label, obj=obj, id='admin.E002')` when it's not the case."	Bug	closed	contrib.admin	3.1	Normal	fixed			Ready for checkin	1	0	0	0	1	0
