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 )
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 , 3 weeks ago
| Cc: | added |
|---|
comment:2 by , 3 weeks ago
| Component: | contrib.sessions → Documentation |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Type: | Uncategorized → Cleanup/optimization |
comment:4 by , 3 weeks ago
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.
Thanks. Let's break out the
__bool__discussion somewhere else so that we can keep the doc fix on the fast-track.