mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #31086 -- Improved error message for admin model inlines with more than one foreign key to the same parent.
This commit is contained in:
committed by
Mariusz Felisiak
parent
ff00a05347
commit
f4647179cc
@@ -1032,7 +1032,8 @@ def _get_foreign_key(parent_model, model, fk_name=None, can_fail=False):
|
||||
)
|
||||
else:
|
||||
raise ValueError(
|
||||
"'%s' has more than one ForeignKey to '%s'." % (
|
||||
"'%s' has more than one ForeignKey to '%s'. You must specify "
|
||||
"a 'fk_name' attribute." % (
|
||||
model._meta.label,
|
||||
parent_model._meta.label,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user