Repository navigation
ref(django): Remove dead Django < 1.7 guard in patch_templates - #8347
Merged
Merged
Conversation
Contributor
Coverage Results 📊✅ 139429 passed | ⏭️ 7905 skipped | Total: 147334 | Pass Rate: 94.63% | Execution Time: 446m 51s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00% (no changed executable lines found; target 80%). Files with missing lines (1)
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 -2Generated by Coverage Action |
sentrivana
marked this pull request as ready for review
November 23, 2026 12:10
sentrivana
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the
if DJANGO_VERSION < (1, 7): returnearly exit frompatch_templates()insentry_sdk/integrations/django/templates.py, along with theDJANGO_VERSIONimport that only this check used.Why it's dead
django.shortcuts.render. The SDK still supported Django 1.6 then._MIN_VERSIONS("django": (1, 8)).DjangoIntegration.setup_once()calls_check_minimum_version(DjangoIntegration, DJANGO_VERSION)first, which raisesDidNotEnablebelow 1.8, beforepatch_templates()runs. On every Django version that reaches this code, the condition is false.django.shortcuts.renderexists in Django 1.8 (checked in the 1.8.19 wheel), so therenderpatch below the guard is safe on the oldest supported version.Why it's safe
DJANGO_VERSIONis not used anywhere else intemplates.py.Not included: the
LoaderOriginimport fallback at the top of the same file looks like dead pre-1.8 compat too (django.template.base.Originalso exists in 1.8). It's left for a separate change to keep this one to a single removal. The inlineimport django.shortcutsthat follows the removed guard is also unchanged.Issues
None.
via automation
sched_65eed06cc199036c2b13411096f412d4· Run IDsched_65eed06cc199036c2b13411096f412d4:1795420800000.--
View Session [Sentry]