﻿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
29320	No exception when an Annotation alias matches a ForeignKey attname	Flávio Juvenal	Flávio Juvenal	"Looks like the solution for ""#11256 Fail loudly and clearly when an Annotation alias matches a field name"" doesn't consider foreign keys {{{attname}}}s, e.g. {{author_id}}.

Here's a failing test, add it to aggregation_regress/tests.py:
{{{
#!python
def test_fk_id_name_conflict(self):
    msg = ""The annotation 'contact_id' conflicts with a field on the model.""
    with self.assertRaisesMessage(ValueError, msg):
        Book.objects.annotate(contact_id=F('publisher_id'))
}}}

I'll make a PR soon."	Bug	assigned	Database layer (models, ORM)	dev	Normal				Unreviewed	1	0	0	0	0	0
