@property
def is_email_confirmed(self):
    from app.modules.auth.models import Code, CodeTypes
    code = Code.query.filter_by(user=self, code_type=CodeTypes.email).order_by(Code.created.desc()).first()
    if (code is None):
        return False
    return code.is_resolved
@property
def is_email_confirmed(self):
    from app.modules.auth.models import Code, CodeTypes
    code = Code.query.filter_by(user=self, code_type=CodeTypes.email).order_by(Code.created.desc()).first()
    if (code is None):
        return False
    return code.is_resolved