'Check to make sure password fields match.'

def clean(self):

    data = super(PasswordForm, self).clean()
    if ('new_password' in data):
        if (data['new_password'] != data.get('confirm_password', None)):
            raise ValidationError(_('Passwords    do    not    match.'))
        if (data.get('confirm_password', None) == data.get('current_password', None)):
            raise ValidationError(_('Old    password    and    new    password    must    be    different'))
    return data
