Opened 7 years ago

Closed 7 years ago

#20791 closed Cleanup/optimization (fixed)

"Model %(model)s with pk %(pk)r does not exist."

Reported by: Luc Saffre Owned by: nobody
Component: Database layer (models, ORM) Version: 1.5
Severity: Normal Keywords:
Cc: eromijn@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


I agree that this is nit-picky, but in db/models/fields/ (line 979 in version 1.5.1), Django issues the following message:

"Model %(model)s with pk %(pk)r does not exist."

This formulation is wrong. Not the model but a model *instance* is missing.
So I suggest to change this message to:

"%(model)s instance with pk %(pk)r does not exist."

or just:

"%(model)s with pk %(pk)r does not exist."

Change History (4)

comment:1 Changed 7 years ago by Sasha Romijn

Cc: eromijn@… added
Easy pickings: set
Triage Stage: UnreviewedAccepted

Agreed, the current message can be confusing.

comment:2 Changed 7 years ago by ersran9

Has patch: set

I have created a pull request for this :

comment:3 Changed 7 years ago by Sasha Romijn

Triage Stage: AcceptedReady for checkin

The patch looks good to me. This message does not seem to be referred to in either tests or documentation, so this should be all that is needed.

comment:4 Changed 7 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In 7295a8262f4f963ba7336337e2cd175be3db6f8c:

[1.6.x] Fixed #20791 -- Reworded ForeignKey default error message

Backport of 311c1d2848 from master.

Note: See TracTickets for help on using tickets.
Back to Top