from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField, DecimalField
from wtforms.validators import DataRequired
from app.models import User

class EditForm(FlaskForm):
    nickname = StringField('nickname', validators=[DataRequired()])
    name     = StringField('name', validators=[DataRequired()])
    age      = IntegerField('age')
    height   = DecimalField('heighti', places=2)


    def __init__(self, original_nickname, *args, **kwargs):
        FlaskForm.__init__(self, *args, **kwargs)
        self.original_nickname = original_nickname

    def validate(self):
        if not FlaskForm.validate(self):
            return False
        if self.nickname.data == self.original_nickname:
            return True
        user = User.query.filter_by(nickname=self.nickname.data).first()
        if user != None:
            self.nickname.errors.append('This nickname is already in use. Please chose another one.')
            return False
        return True

@@ -158,16 +158,17 @@
 t User%0A%0A
+%0A
 class Ed
@@ -263,20 +263,16 @@
    name 
-    
 = String
@@ -322,21 +322,16 @@
     age 
-     
 = Intege
@@ -355,18 +355,16 @@
  height 
-  
 = Decima
@@ -392,17 +392,16 @@
 ces=2)%0A%0A
-%0A
     def 
@@ -817,16 +817,8 @@
 user
- != None
 :%0A  
@@ -831,36 +831,14 @@
     
-self.nickname.errors.append(
+msg = 
 'Thi
@@ -893,16 +893,60 @@
 er one.'
+%0A            self.nickname.errors.append(msg
 )%0A      

Modify to fit with PEP8 standard