[2.0.x] Fixed #29375 -- Removed empty action attribute on HTML forms.

Backport of 4660ce5a69 from master
This commit is contained in:
CHI Cheng 2018-05-02 23:20:04 +10:00 committed by Tim Graham
parent 3003830008
commit 482ba9246e
9 changed files with 36 additions and 36 deletions

View file

@ -630,7 +630,7 @@ The ``manage_articles.html`` template might look like this:
.. code-block:: html+django
<form method="post" action="">
<form method="post">
{{ formset.management_form }}
<table>
{% for form in formset %}
@ -644,7 +644,7 @@ deal with the management form:
.. code-block:: html+django
<form method="post" action="">
<form method="post">
<table>
{{ formset }}
</table>
@ -662,7 +662,7 @@ If you manually render fields in the template, you can render
.. code-block:: html+django
<form method="post" action="">
<form method="post">
{{ formset.management_form }}
{% for form in formset %}
<ul>

View file

@ -1064,14 +1064,14 @@ There are three ways to render a formset in a Django template.
First, you can let the formset do most of the work::
<form method="post" action="">
<form method="post">
{{ formset }}
</form>
Second, you can manually render the formset, but let the form deal with
itself::
<form method="post" action="">
<form method="post">
{{ formset.management_form }}
{% for form in formset %}
{{ form }}
@ -1084,7 +1084,7 @@ form as shown above. See the :ref:`management form documentation
Third, you can manually render each field::
<form method="post" action="">
<form method="post">
{{ formset.management_form }}
{% for form in formset %}
{% for field in form %}
@ -1097,7 +1097,7 @@ If you opt to use this third method and you don't iterate over the fields with
a ``{% for %}`` loop, you'll need to render the primary key field. For example,
if you were rendering the ``name`` and ``age`` fields of a model::
<form method="post" action="">
<form method="post">
{{ formset.management_form }}
{% for form in formset %}
{{ form.id }}