def set_mn_controlled_values(request, sysmeta_pyxb, is_modification):
    """See the description of TRUST_CLIENT_* in settings.py."""
    now_datetime = d1_common.date_time.utc_now()

    default_value_list = [
        ('originMemberNode', django.conf.settings.NODE_IDENTIFIER, True),
        ('authoritativeMemberNode', django.conf.settings.NODE_IDENTIFIER, True),
        ('serialVersion', 1, False),
        ('dateUploaded', now_datetime, False),
    ]

    if not is_modification:
        # submitter cannot be updated as the CN does not allow it.
        default_value_list.append(('submitter', request.primary_subject_str, True))
        # dateSysMetadataModified cannot be updated as it is used for optimistic
        # locking. If changed, it is assumed that optimistic locking failed, and the
        # update is rejected in order to prevent a concurrent update from being lost.
        default_value_list.append(('dateSysMetadataModified', now_datetime, False))
    else:
        sysmeta_pyxb.submitter = None
        sysmeta_pyxb.dateSysMetadataModified = now_datetime

    for attr_str, default_value, is_simple_content in default_value_list:
        is_trusted_from_client = getattr(
            django.conf.settings, 'TRUST_CLIENT_{}'.format(attr_str.upper()), False
        )
        override_value = None
        if is_trusted_from_client:
            override_value = (
                d1_common.xml.get_opt_val(sysmeta_pyxb, attr_str)
                if is_simple_content
                else getattr(sysmeta_pyxb, attr_str, None)
            )
        setattr(sysmeta_pyxb, attr_str, override_value or default_value)
See the description of TRUST_CLIENT_* in settings.py.