From 886180ff618f9ee6ec62e13faba63c05a7c52118 Mon Sep 17 00:00:00 2001 From: Johan Lundberg Date: Wed, 18 May 2011 15:10:51 +0200 Subject: Change the way change_other works. --- models.py | 6 +----- templates/changepw/change_other.html | 14 +++----------- views.py | 6 ++---- 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 %}

Change other

-{% if form %} -

- {{ form.non_field_errors }} -

+{% if return_value == None %}
{% csrf_token %} - {% for field in form %} - + - - - - + - {% endfor %}
{{ field.errors }}Input:
{{ field.label_tag }}:
{{ field }}
{% 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)) -- cgit v1.1