def METHOD_NAME(mapper, connection, target):  # pylint: disable=unused-argument; SQLAlchemy callback signature
    """Run checks/updates before adding/changing the party model data."""
    party = target
    # skip this party updater if the flag is set
    # Scenario: data loading party data that is missing required party information
    if hasattr(party, 'skip_party_listener') and party.skip_party_listener:
        return
    if not party.valid_party_type_data:
        raise BusinessException(
            error=f'Attempt to change/add {party.party_type} had invalid data.',
            status_code=HTTPStatus.BAD_REQUEST
        )