src/pds_doi_service/core/outputs/doi_validator.py
def _check_identifier_fields(self, doi: Doi):
        """
        Checks the fields of a Doi object used for identification for consistency
        and validity.

        Parameters
        ----------
        doi : Doi
            The parsed Doi object to validate

        Raises
        ------
        InvalidRecordException
            If any of the identifier field checks fail

        """
        # Make sure we have an identifier to key off of
        if not doi.pds_identifier:
            raise InvalidRecordException(
                "Record provided with missing PDS identifier field. "
                "Please ensure a LIDVID or similar identifier is provided for "
                "all DOI requests."
            )

        # Make sure the doi and id fields are consistent, if present
        if doi.doi and doi.id:
            prefix, suffix = doi.doi.split("/")

            if suffix != doi.id:
                raise InvalidRecordException(
                    f"Record for {doi.pds_identifier} has inconsistent "
                    f"DOI ({doi.doi}) and ID ({doi.id}) fields. Please reconcile "
                    "the inconsistency and resubmit the request."
                )

        Checks the fields of a Doi object used for identification for consistency
        and validity.

        Parameters
        ----------
        doi : Doi
            The parsed Doi object to validate

        Raises
        ------
        InvalidRecordException
            If any of the identifier field checks fail

        
Checks the fields of a Doi object used for identification for consistency
and validity.

Parameters

doi : Doi
The parsed Doi object to validate

Raises

InvalidRecordException
If any of the identifier field checks fail
Checks the fields of a Doi object used for identification for consistency and validity . Parameters doi : Doi The parsed Doi object to validate Raises InvalidRecordException If any of the identifier field checks fail
def _check_identifier_fields(self, doi: Doi):
        if not doi.pds_identifier:
            raise InvalidRecordException(
                "Record provided with missing PDS identifier field. "
                "Please ensure a LIDVID or similar identifier is provided for "
                "all DOI requests."
            )
        if doi.doi and doi.id:
            prefix, suffix = doi.doi.split("/")
            if suffix != doi.id:
                raise InvalidRecordException(
                    f"Record for {doi.pds_identifier} has inconsistent "
                    f"DOI ({doi.doi}) and ID ({doi.id}) fields. Please reconcile "
                    "the inconsistency and resubmit the request."
                )
def _check_identifier_fields ( self , doi : Doi ) : if not doi . pds_identifier : raise InvalidRecordException ( "Record provided with missing PDS identifier field. " "Please ensure a LIDVID or similar identifier is provided for " "all DOI requests." ) if doi . doi and doi . id : prefix , suffix = doi . doi . split ( "/" ) if suffix != doi . id : raise InvalidRecordException ( f"Record for {doi.pds_identifier} has inconsistent " f"DOI ({doi.doi}) and ID ({doi.id}) fields. Please reconcile " "the inconsistency and resubmit the request." )
Checks the fields of a Doi object used for identification for consistency
and validity.
Checks the fields of a Doi object used for identification for consistency and validity .
"""
        Checks the fields of a Doi object used for identification for consistency
        and validity.

        Parameters
        ----------
        doi : Doi
            The parsed Doi object to validate

        Raises
        ------
        InvalidRecordException
            If any of the identifier field checks fail

        """ # Make sure we have an identifier to key off of # Make sure the doi and id fields are consistent, if present
self
doi
Doi