summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorShubham singh <shubham1.singh15@gmail.com>2019-12-17 02:46:39 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-12-17 09:15:01 +0100
commitf4647179ccd13c852563205273163b641d4b01a5 (patch)
tree1c1610b8909b6ad67a629ac112875521cc510243 /django/forms
parentff00a053478fee06bdfb4206c6d4e079e98640ff (diff)
Fixed #31086 -- Improved error message for admin model inlines with more than one foreign key to the same parent.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index d72c62f7f0..0684199db5 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -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,
)