code: def clean(self):
          '''Check to make sure password fields match.'''
          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 datf clean(self):
          '''Check to make sure password fields match.'''
          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
docs: Check to make sure password fields match.