old_contents: 
  from flask import current_app
  from flask.ext.wtf import (Form, TextField, PasswordField, Required, Email,
                             Length, Regexp, ValidationError, EqualTo)
  
  
  class UniqueUser(object):
      def __init__(self, message="User exists"):
          self.message = message
  
      def __call__(self, form, field):
          if current_app.security.datastore.find_user(email=field.data):
              raise ValidationError(self.message)
  
  
  validators = {
      'email': [
          Required(),
          Email(),
          UniqueUser(message='Email address is associated with '
                             'an existing account')
      ],
      'password': [
          Required(),
          Length(min=6, max=50),
          EqualTo('confirm', message='Passwords must match'),
          Regexp(r'[A-Za-z0-9@#$%^&+=]',
                 message='Password contains invalid characters')
      ]
  }
  
  
  class RegisterForm(Form):
      email = TextField('Email', validators['email'])
      password = PasswordField('Password', validators['password'], )
      confirm = PasswordField('Confirm Password')
  
new_contents: 
  from flask import current_app
  from flask.ext.wtf import Form
  from wtforms import TextField, PasswordField, ValidationError
  from wtforms.validators import Required, Email, Length, Regexp, EqualTo
  
  class UniqueUser(object):
      def __init__(self, message="User exists"):
          self.message = message
  
      def __call__(self, form, field):
          if current_app.security.datastore.find_user(email=field.data):
              raise ValidationError(self.message)
  
  
  validators = {
      'email': [
          Required(),
          Email(),
          UniqueUser(message='Email address is associated with '
                             'an existing account')
      ],
      'password': [
          Required(),
          Length(min=6, max=50),
          EqualTo('confirm', message='Passwords must match'),
          Regexp(r'[A-Za-z0-9@#$%^&+=]',
                 message='Password contains invalid characters')
      ]
  }
  
  
  class RegisterForm(Form):
      email = TextField('Email', validators['email'])
      password = PasswordField('Password', validators['password'], )
      confirm = PasswordField('Confirm Password')
  
subject: fix import issues with latest version of Flask-WTF