Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
8b30967e
Commit
8b30967e
authored
Nov 14, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #372 and #366. Emit csrf_token when rendering forms if it is present
parent
cdb4a411
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
actions.html
flask_admin/templates/admin/actions.html
+3
-0
lib.html
flask_admin/templates/admin/lib.html
+5
-1
No files found.
flask_admin/templates/admin/actions.html
View file @
8b30967e
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
{% macro form(actions, url) %}
{% macro form(actions, url) %}
{% if actions %}
{% if actions %}
<form
id=
"action_form"
action=
"{{ url }}"
method=
"POST"
style=
"display: none"
>
<form
id=
"action_form"
action=
"{{ url }}"
method=
"POST"
style=
"display: none"
>
{% if csrf_token %}
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
/>
{% endif %}
<input
type=
"hidden"
id=
"action"
name=
"action"
/>
<input
type=
"hidden"
id=
"action"
name=
"action"
/>
</form>
</form>
{% endif %}
{% endif %}
...
...
flask_admin/templates/admin/lib.html
View file @
8b30967e
...
@@ -112,7 +112,11 @@
...
@@ -112,7 +112,11 @@
{% if form.hidden_tag is defined %}
{% if form.hidden_tag is defined %}
{{ form.hidden_tag() }}
{{ form.hidden_tag() }}
{% else %}
{% else %}
{% for f in form if f.type == 'HiddenField' %}
{% if csrf_token %}
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
/>
{% endif %}
{% for f in form if f.type == 'HiddenField' %}
{{ f }}
{{ f }}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment