Skip to content

ref(django): Remove dead Django < 1.7 guard in patch_templates - #8347

Merged
sentrivana merged 1 commit into
masterfrom
ref/django-drop-pre-1.7-render-guard
Nov 23, 2026
Merged

sentrivana merged 1 commit into
masterfrom
ref/django-drop-pre-1.7-render-guard

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Description

Removes the if DJANGO_VERSION < (1, 7): return early exit from patch_templates() in sentry_sdk/integrations/django/templates.py, along with the DJANGO_VERSION import that only this check used.

Why it's dead

Why it's safe

  • No behavior change on any supported Django version: the branch could never be taken.
  • No public API, documented behavior, supported versions or dependencies change.
  • DJANGO_VERSION is not used anywhere else in templates.py.

Not included: the LoaderOrigin import fallback at the top of the same file looks like dead pre-1.8 compat too (django.template.base.Origin also exists in 1.8). It's left for a separate change to keep this one to a single removal. The inline import django.shortcuts that follows the removed guard is also unchanged.

Issues

None.

via automation sched_65eed06cc199036c2b13411096f412d4 · Run ID sched_65eed06cc199036c2b13411096f412d4:1795420800000.

--

View Session [Sentry]

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 139429 passed | ⏭️ 7905 skipped | Total: 147334 | Pass Rate: 94.63% | Execution Time: 446m 51s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -1
Passed Tests —
Failed Tests 📉 -1
Skipped Tests —

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.25% (up 0.03 percentage points from base (c5756d4) to head (b174868)).

Files with missing lines (1)
File Coverage % Lines
sentry_sdk/integrations/django/templates.py 64.86% ⚠️ 39 Missing and 8 partials
Coverage diff
@@            Coverage Diff             @@
##        master     #8347       +/-##
==========================================
+ Coverage    90.22%    90.25%    +0.03%
==========================================
  Files          203       203         —
  Tracked lines     27349     27346        -3
  Branches     10252     10250        -2
==========================================
+ Hits         24673     24679        +6
+ Misses        2676      2667        -9
+ Partials      1559      1557        -2

Generated by Coverage Action

@sentrivana
sentrivana marked this pull request as ready for review November 23, 2026 12:10
@sentrivana
sentrivana requested a review from a team as a code owner November 23, 2026 12:10
@sentrivana
sentrivana merged commit 74c4ca8 into master Nov 23, 2026
185 checks passed
@sentrivana
sentrivana deleted the ref/django-drop-pre-1.7-render-guard branch November 23, 2026 12:11
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.

1 participant