Code

Opened 3 years ago

Closed 3 years ago

#16009 closed Cleanup/optimization (fixed)

CSRF_FAILRE_TEMPLATE is misspelled

Reported by: adehnert Owned by: nobody
Component: contrib.csrf Version: 1.3
Severity: Normal Keywords:
Cc: adehnert Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX:

Description

The CSRF_FAILRE_TEMPLATE variable appears to be misspelled.

diff --git a/django/views/csrf.py b/django/views/csrf.py
index 038b0b7..80cc21d 100644
--- a/django/views/csrf.py
+++ b/django/views/csrf.py
@@ -6,7 +6,7 @@ from django.conf import settings
 # this error message, especially for the sake of developers, and there isn't any
 # other way of making it available independent of what is in the settings file.
 
-CSRF_FAILRE_TEMPLATE = """
+CSRF_FAILURE_TEMPLATE = """
 <!DOCTYPE html>
 <html lang="en">
 <head>
@@ -94,7 +94,7 @@ def csrf_failure(request, reason=""):
     Default view used when request fails CSRF protection
     """
     from django.middleware.csrf import REASON_NO_REFERER
-    t = Template(CSRF_FAILRE_TEMPLATE)
+    t = Template(CSRF_FAILURE_TEMPLATE)
     c = Context({'DEBUG': settings.DEBUG,
                  'reason': reason,
                  'no_referer': reason == REASON_NO_REFERER

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by adehnert

  • Cc adehnert added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by julien

  • Triage Stage changed from Unreviewed to Ready for checkin

And this comes after my "fail*t*ure" in #16002. The word "failure" must be prone to attracting typos :-)

comment:3 Changed 3 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from new to closed

In [16216]:

Fixed #16009 - typo in CSRF_FAILRE_TEMPLATE.

Thanks to adehnert for report and patch.

Though I flail to see what problem it was causing...

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.