Opened 5 years ago

Closed 5 years ago

#17506 closed Cleanup/optimization (fixed)

Minor tidyup in session DB backend

Reported by: FunkyBob Owned by: nobody
Component: contrib.sessions Version: master
Severity: Normal Keywords: session
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

The ORM docs suggest using exists() can be more efficient than try:get()/except:

Here's a patch to do just that in the session DB backend.

Attachments (2)

session_db.patch (581 bytes) - added by FunkyBob 5 years ago.
session_db-1.patch (588 bytes) - added by FunkyBob 5 years ago.
Fixed as requested

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by FunkyBob

Attachment: session_db.patch added

comment:1 Changed 5 years ago by Luke Plant

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Accepted, but the method needs to actually return the value - with your patch it returns None always. Once this is fixed the ticket can be marked 'ready for checkin'.

Changed 5 years ago by FunkyBob

Attachment: session_db-1.patch added

Fixed as requested

comment:2 Changed 5 years ago by anonymous

Patch needs improvement: unset

comment:3 Changed 5 years ago by Claude Paroz

Triage Stage: AcceptedReady for checkin

comment:4 Changed 5 years ago by Julien Phalip

Resolution: fixed
Status: newclosed

In [17390]:

(The changeset message doesn't reference this ticket)

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