def METHOD_NAME(user, key, value, user_change_logger):
    if getattr(user, key) != value:
        setattr(user, key, value)
        if user_change_logger:
            user_change_logger.add_changes({key: value})