RepoJournal
Django

@django

Python's batteries-included web framework

Keep up with Django in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

One email a day. Unsubscribe in one click.

Pick a date

Topics: Python Full archive →

The Wire · Showcase

DJANGO PATCHES CRITICAL QUERY ORDERING BUG AFFECTING UNIONS

By RepoJournal · Filed · About Django

Django fixed a regression in combined queries that broke ordering on union, intersection, and difference operations, potentially causing incorrect result sets in production.

The fix [1] addresses ticket #37097, a regression introduced in commit 087bb9e8f that drove traffic into an existing error path. When using union(), intersect(), or difference() operations with explicit order_by() calls, Django was failing to properly clear ordering on the inner combined queries, leading to unexpected result behavior. The team also removed redundant compilation-time order clearing on Oracle [2], which was handling the same issue inefficiently. In parallel, Django shipped a security-focused update [3] adding CSP nonce support to error pages, admin templates, and registration forms. All explicit script, link, and style elements in these templates now use the {% csp_nonce %} tag when available, hardening Django's default templates against inline script injection attacks.

One email a day. Unsubscribe in one click.

Action items

References

  1. [1] Fixed #37097 -- Made Query.clear_ordering() clear ordering on combined queries also. ↗ django/django
  2. [2] Refs #37097 -- Removed compilation-time order clearing on combined queries on Oracle. django/django
  3. [3] Fixed #36825 -- Included CSP nonce in templates if available. ↗ django/django

Quick answers

What shipped in Django on May 19, 2026?
Django fixed a regression in combined queries that broke ordering on union, intersection, and difference operations, potentially causing incorrect result sets in production. In total, 5 commits and 2 pull requests landed.
Who contributed to Django on May 19, 2026?
2 developers shipped this update, including jacobtylerwalls and codingjoe.
What were the notable Django updates?
Fixed #37097 -- Made Query.clear_ordering() clear ordering on combined queries also, Refs #37097 -- Removed compilation-time order clearing on combined queries on Oracle, and Fixed #36825 -- Included CSP nonce in templates if available.

More from @django

Daily updates, in your inbox

Follow Django

Keep up with Django in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

or

One email a day. Unsubscribe in one click. Read a past issue →

Elsewhere on the wire

Want every project, not just this one?