summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Lundberg <lundberg@nordu.net>2011-05-18 15:10:51 +0200
committerJohan Lundberg <lundberg@nordu.net>2011-05-18 15:10:51 +0200
commit886180ff618f9ee6ec62e13faba63c05a7c52118 (patch)
tree1f6a59a35964b3cf818a7bf6351c08fe1eb48f08
parentb13437cf81b18bb20ac87268c480cefc268a43d0 (diff)
Change the way change_other works.
-rw-r--r--models.py6
-rw-r--r--templates/changepw/change_other.html14
-rw-r--r--views.py6
3 files changed, 6 insertions, 20 deletions
diff --git a/models.py b/models.py
index 5c499bc..5c286c1 100644
--- a/models.py
+++ b/models.py
@@ -32,8 +32,4 @@ case letter and one lower case letter in your password.')
if not re.search('[,.\[\]!@#$%^&*?_\(\)-]', new_password):
raise forms.ValidationError('You need at least one special \
character i.e. ,.][!@#$%^&*?_()-')
- return cleaned_data
-
-
-class ChangeOtherForm(forms.Form):
- new_attrib = forms.CharField(widget=forms.Textarea) \ No newline at end of file
+ return cleaned_data \ No newline at end of file
diff --git a/templates/changepw/change_other.html b/templates/changepw/change_other.html
index 4351b45..c3fa637 100644
--- a/templates/changepw/change_other.html
+++ b/templates/changepw/change_other.html
@@ -4,26 +4,18 @@
{% block title %}Change other{% endblock %}
{% block content %}
<h2>Change other</h2>
-{% if form %}
- <p class="error">
- {{ form.non_field_errors }}
- </p>
+{% if return_value == None %}
<form action="{% url changeother %}" method="post" autocomplete="off">{% csrf_token %}
<table>
- {% for field in form %}
<tr>
- <td class="fielderrors">{{ field.errors }}</td>
+ <td class="formlabel">Input:</td>
</tr>
<tr>
- <td class="formlabel">{{ field.label_tag }}:</td>
- </tr>
- <tr>
- <td class="formfield">{{ field }}</td>
+ <td class="formfield"><input type="textarea" name="input" /></td>
</tr>
<tr>
<td class="formbutton"><input type="submit" value="Submit" /></td>
</tr>
- {% endfor %}
</table>
</form>
{% else %}
diff --git a/views.py b/views.py
index 43860d7..fd2c0ce 100644
--- a/views.py
+++ b/views.py
@@ -1,5 +1,5 @@
from django.contrib.auth.decorators import login_required
-from apps.changepw.models import ChangePasswordForm, ChangeOtherForm
+from apps.changepw.models import ChangePasswordForm
from django.shortcuts import render_to_response
from django.template import RequestContext
# import your_pw_change_module
@@ -111,8 +111,6 @@ def change_other(request):
{'username': username, 'return_value': return_value},
context_instance=RequestContext(request))
else:
- form = ChangeOtherForm()
return render_to_response('changepw/change_other.html',
- {'username': username, 'return_value': None,
- 'form': form},
+ {'username': username, 'return_value': None},
context_instance=RequestContext(request))