From 482ba9246e1838378a7e320c247fa7338ca49b40 Mon Sep 17 00:00:00 2001 From: CHI Cheng Date: Wed, 2 May 2018 23:20:04 +1000 Subject: [PATCH] [2.0.x] Fixed #29375 -- Removed empty action attribute on HTML forms. Backport of 4660ce5a6930e07899ed083801845ee4c44c09df from master --- .../ref/class-based-views/generic-editing.txt | 8 ++--- docs/ref/csrf.txt | 4 +-- docs/topics/forms/formsets.txt | 6 ++-- docs/topics/forms/modelforms.txt | 8 ++--- .../templates/forms_tests/article_form.html | 2 +- tests/forms_tests/tests/test_forms.py | 34 +++++++++---------- tests/templates/form_view.html | 2 +- tests/templates/login.html | 2 +- tests/test_utils/tests.py | 6 ++-- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/ref/class-based-views/generic-editing.txt b/docs/ref/class-based-views/generic-editing.txt index 65cd7725367..b4bf7e94806 100644 --- a/docs/ref/class-based-views/generic-editing.txt +++ b/docs/ref/class-based-views/generic-editing.txt @@ -74,7 +74,7 @@ editing content: .. code-block:: html+django -
{% csrf_token %} + {% csrf_token %} {{ form.as_p }}
@@ -130,7 +130,7 @@ editing content: .. code-block:: html+django -
{% csrf_token %} + {% csrf_token %} {{ form.as_p }}
@@ -187,7 +187,7 @@ editing content: .. code-block:: html+django -
{% csrf_token %} + {% csrf_token %} {{ form.as_p }}
@@ -238,7 +238,7 @@ editing content: .. code-block:: html+django -
{% csrf_token %} + {% csrf_token %}

Are you sure you want to delete "{{ object }}"?

diff --git a/docs/ref/csrf.txt b/docs/ref/csrf.txt index dd5ea479ae5..d79bfd9dd9c 100644 --- a/docs/ref/csrf.txt +++ b/docs/ref/csrf.txt @@ -41,7 +41,7 @@ To take advantage of CSRF protection in your views, follow these steps: .. code-block:: html+django -
{% csrf_token %} + {% csrf_token %} This should not be done for POST forms that target external URLs, since that would cause the CSRF token to be leaked, leading to a vulnerability. @@ -179,7 +179,7 @@ to ``{% csrf_token %}`` in the Django template language. For example: .. code-block:: html+jinja - {{ csrf_input }} + {{ csrf_input }} The decorator method -------------------- diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index 08c0194e535..c7134b10de2 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -630,7 +630,7 @@ The ``manage_articles.html`` template might look like this: .. code-block:: html+django - + {{ formset.management_form }} {% for form in formset %} @@ -644,7 +644,7 @@ deal with the management form: .. code-block:: html+django - +
{{ formset }}
@@ -662,7 +662,7 @@ If you manually render fields in the template, you can render .. code-block:: html+django - + {{ formset.management_form }} {% for form in formset %}