Code

Opened 3 years ago

Closed 2 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 3 years ago.
session_db-1.patch (588 bytes) - added by FunkyBob 3 years ago.
Fixed as requested

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by FunkyBob

comment:1 Changed 3 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

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 3 years ago by FunkyBob

Fixed as requested

comment:2 Changed 2 years ago by anonymous

  • Patch needs improvement unset

comment:3 Changed 2 years ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 2 years ago by julien

  • Resolution set to fixed
  • Status changed from new to closed

In [17390]:

(The changeset message doesn't reference this ticket)

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.