Code

Opened 6 years ago

Closed 6 years ago

#8093 closed (worksforme)

ForeignKey's raise DoesNotExist instead of returning None

Reported by: dcramer Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When accessing a nullable ForeignKey it raises a DoesNotExist error instead of returning None when the value is set to NULL.

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by gwilson

(In [8198]) Added tests for accessing nullable ForeignKey after saving and fetching from the database (refs #8093).

comment:2 Changed 6 years ago by gwilson

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

Can you provide a failing test case, as tests in [8185] and [8189] seem to cover your situation.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.