Opened 3 weeks ago

Last modified 3 weeks ago

#36898 closed Cleanup/optimization

Document `Session.is_empty` — at Version 4

Reported by: Jake Howard Owned by: jaffar Khan
Component: Documentation Version: 4.2
Severity: Normal Keywords:
Cc: jaffar Khan 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 (last modified by Jake Howard)

It's often useful to check whether the user has a session, for example to avoid creating one unnecessarily. Since request.session is always populated when SessionMiddleware is used, it's better to check whether the session is empty. BaseSession has a is_empty method, but it's undocumented.

It should be documented.

Change History (4)

comment:1 by jaffar Khan, 3 weeks ago

Cc: jaffar Khan added

comment:2 by Jacob Walls, 3 weeks ago

Component: contrib.sessionsDocumentation
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

Thanks. Let's break out the __bool__ discussion somewhere else so that we can keep the doc fix on the fast-track.

comment:3 by jaffar Khan, 3 weeks ago

Owner: set to jaffar Khan
Status: newassigned

Want to work on this ticket

comment:4 by Jake Howard, 3 weeks ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top