1
0
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:
Shubham singh
2019-12-17 02:46:39 +05:30
committed by Mariusz Felisiak
parent ff00a05347
commit f4647179cc
3 changed files with 7 additions and 3 deletions

View File

@@ -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,
)