[snowy] Make openid login work with django 1.3 csrf
- From: Jeff Schroeder <jschroeder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snowy] Make openid login work with django 1.3 csrf
- Date: Mon, 10 Oct 2011 01:28:43 +0000 (UTC)
commit dfce31925bcbd2815200920027b9a78116b7d11a
Author: Jeff Schroeder <jeffschroeder computer org>
Date: Sun Oct 9 18:26:13 2011 -0700
Make openid login work with django 1.3 csrf
Also put the {% csrf_token %} on the same line as the <form> tag
so it is easier to verify with git grep.
accounts/templates/accounts/login.html | 2 +-
accounts/templates/registration/login.html | 3 +--
.../templates/registration/registration_form.html | 3 +--
3 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/accounts/templates/accounts/login.html b/accounts/templates/accounts/login.html
index 80a341e..0077bdd 100644
--- a/accounts/templates/accounts/login.html
+++ b/accounts/templates/accounts/login.html
@@ -64,7 +64,7 @@
<input type="button" id="openid-provider-username-submit" value="{% trans "Log in" %}">
</div>
- <form style="display: none" id="openid-login-form" name="fopenid" action="{% url openid-login %}" method="post">
+ <form style="display: none" id="openid-login-form" name="fopenid" action="{% url openid-login %}" method="post">{% csrf_token %}
<h3>{% trans "OpenID" %}</h3>
<b>{{ openid_form.openid_identifier.label_tag }}</b>
{{ openid_form.openid_identifier }}
diff --git a/accounts/templates/registration/login.html b/accounts/templates/registration/login.html
index 83a35e5..3cf6133 100644
--- a/accounts/templates/registration/login.html
+++ b/accounts/templates/registration/login.html
@@ -8,8 +8,7 @@
{% endif %}
<h3>{% trans "Log in" %}</h3>
-<form method="post" action=".">
-{% csrf_token %}
+<form method="post" action=".">{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag }}</td>
diff --git a/accounts/templates/registration/registration_form.html b/accounts/templates/registration/registration_form.html
index 3a863bf..054a803 100644
--- a/accounts/templates/registration/registration_form.html
+++ b/accounts/templates/registration/registration_form.html
@@ -11,8 +11,7 @@
{% block content %}
<h1>Tell {{ site.name }} about yourself!</h1>
-<form method="POST">
- {% csrf_token %}
+<form method="POST">{% csrf_token %}
<p>
<label for="username" class="registration-form-label">{{ form.username.label }}:</label>
{{ form.username }}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]