summaryrefslogtreecommitdiff
path: root/django/core/checks/security/csrf.py
diff options
context:
space:
mode:
author93578237 <43147888+93578237@users.noreply.github.com>2026-02-09 16:06:50 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-10 16:54:46 -0500
commitdeac58ed822c6cd819e916e6c3d1736c7adfa31e (patch)
tree705f1e46ce13320352804c299509fcf8fa3e27af /django/core/checks/security/csrf.py
parent254b30483def1fa75270de9f45ad1f2a19f39bdb (diff)
[6.0.x] Fixed #36903 -- Fixed further NameErrors when inspecting functions with deferred annotations.
Provide a wrapper for safe introspection of user functions on Python 3.14+. Follow-up to 601914722956cc41f1f2c53972d669ddee6ffc04. Backport of 56ed37e17e5b1a509aa68a0c797dcff34fcc1366 from main.
Diffstat (limited to 'django/core/checks/security/csrf.py')
-rw-r--r--django/core/checks/security/csrf.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/core/checks/security/csrf.py b/django/core/checks/security/csrf.py
index d00f2259c6..51be377f48 100644
--- a/django/core/checks/security/csrf.py
+++ b/django/core/checks/security/csrf.py
@@ -1,6 +1,5 @@
-import inspect
-
from django.conf import settings
+from django.utils.inspect import signature
from .. import Error, Tags, Warning, register
@@ -57,7 +56,7 @@ def check_csrf_failure_view(app_configs, **kwargs):
errors.append(Error(msg, id="security.E102"))
else:
try:
- inspect.signature(view).bind(None, reason=None)
+ signature(view).bind(None, reason=None)
except TypeError:
msg = (
"The CSRF failure view '%s' does not take the correct number of "