Skip to content
/ django Public

Fixed #36898 -- Documented SessionBase.is_empty().#20630

Merged
jacobtylerwalls merged 1 commit intodjango:mainfrom
jafarkhan83:36898-fix
Feb 3, 2026
Merged

Fixed #36898 -- Documented SessionBase.is_empty().#20630
jacobtylerwalls merged 1 commit intodjango:mainfrom
jafarkhan83:36898-fix

Conversation

@jafarkhan83
Copy link
Contributor

Trac ticket number

ticket-36898

Branch description

To check whether the user has a session need to use Session.is_empty() but this method is not documented. Another way to check is request.session but that will always be populated if SessionMiddleware is enabled so it returns True on empty session too that makes it a pitfall.

AI Assistance Disclosure (REQUIRED)

  • No AI tools were used in preparing this PR.
  • If AI tools were used, I have disclosed which ones, and fully reviewed and verified their output.

Checklist

  • This PR follows the contribution guidelines.
  • This PR does not disclose a security vulnerability (see vulnerability reporting).
  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

@jacobtylerwalls jacobtylerwalls changed the title Fixed #36898 -- Session.is_empty() documented Fixed #36898 -- Documented SessionBase.is_empty(). Feb 2, 2026
Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jafarkhan83, but next time please be more careful about following the commit message style referenced in the PR checklist. I'll update it for you.

@jacobtylerwalls
Copy link
Member

jacobtylerwalls commented Feb 2, 2026

@jafarkhan83 careful, there are multiple typos in your commit message, and no trailing period.

@jacobtylerwalls jacobtylerwalls merged commit 13299a6 into django:main Feb 3, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants