Improving error message for admin.E202

38 views
Skip to first unread message

Shubham Singh

unread,
Dec 16, 2019, 8:51:20 AM12/16/19
to Django developers (Contributions to Django itself)
I am new to contributing to django, and i have picked up a ticket listed as easy picking #31086.

It states to make the admin E.202 message (admin inline having, multiple foreign keys to the same parent model), to recommend specifying fk_name.

To do so the error message in the ValueError raised by the _get_foreign_key() method must be changed. My concern is, if this change is made then whenever the method will raise an error the new error message recommending the fk_names will be used, hence the change is not restricted to the admin error code only. Will it cause any backward compatibility issues ?  Or is it safe to make this change ?

And is the format for the error message given below, is acceptable ?

'appName.ModelOne' has more than one ForeignKeys ('fk_one', 'fk_two') to 'appName.ModelTwo'.


Thanks !

Mariusz Felisiak

unread,
Dec 16, 2019, 8:57:51 AM12/16/19
to Django developers (Contributions to Django itself)
It's safe to make change to warning messages.
Reply all
Reply to author
Forward
0 new messages