Add Validate NPI in the models.py for User Profile
Use this example to validate email
def validate_email(self, email): user = User.query.filter_by(email=email.data).first() if user is not None: raise ValidationError('Please use a different email address.')