def update_user_email(user: model.User, email: str) -> None: assert user email = email.strip() if util.value_exceeds_column_size(email, model.User.email): raise InvalidEmailError('Email is too long.') if not util.is_valid_email(email): raise InvalidEmailError('E-mail is invalid.') user.email = email or None
def update_user_email(user: model.User, email: str) -> None: assert user email = email.strip() if util.value_exceeds_column_size(email, model.User.email): raise InvalidEmailError('이메일이 너무 깁니다.') if not util.is_valid_email(email): raise InvalidEmailError('잘못된 이메일입니다.') user.email = email or None
def update_email(user, email): if email: email = email.strip() if not email: email = None if email and util.value_exceeds_column_size(email, db.User.email): raise InvalidEmailError('Email is too long.') if not util.is_valid_email(email): raise InvalidEmailError('E-mail is invalid.') user.email = email
def update_user_email(user, email): if email: email = email.strip() if not email: email = None if email and util.value_exceeds_column_size(email, db.User.email): raise InvalidEmailError('Email is too long.') if not util.is_valid_email(email): raise InvalidEmailError('E-mail is invalid.') user.email = email