Opened 6 weeks ago

Closed 6 weeks ago

#36100 closed Cleanup/optimization (fixed)

get_next_by_FIELD() check for unsaved objects should account for composite primary keys

Reported by: Jacob Walls Owned by: Jacob Walls
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

PR to keep the check for unsaved objects at the top of get_next_by_FIELD() compatible with unsaved objects having composite primary keys.

More of a cleanup (?), since ValueError was still being raised at the ORM level:

AssertionError: 'get_next/get_previous cannot be used on unsaved objects.' not found in 'Cannot use None as a query value'

Change History (3)

comment:1 by Sarah Boyce, 6 weeks ago

Triage Stage: UnreviewedAccepted

Thank you!

comment:2 by Sarah Boyce, 6 weeks ago

Triage Stage: AcceptedReady for checkin

comment:3 by Sarah Boyce <42296566+sarahboyce@…>, 6 weeks ago

Resolution: fixed
Status: assignedclosed

In 1602666:

Fixed #36100 -- Checked if composite pk is set in get_next/get_previous.

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