src/pds_doi_service/core/actions/update.py
def _validate_dois(self, dois):
        """
        Validates the list of DOI objects prior to their submission.

        Depending on the configuration of the DOI service, DOI objects may
        be validated against a schema as well as the internal checks performed
        by the validator class.

        Any exceptions or warnings encountered during the checks are stored
        until all DOI's have been checked. Depending on the state of the
        force flag, these collected exceptions are either raised as a single
        exception, or simply logged.

        Parameters
        ----------
        dois : list of Doi
            The DOI objects to validate.

        Returns
        -------
        dois : list of Doi
            The validated list of DOI objects.

        """
        exception_classes = []
        exception_messages = []

        for doi in dois:
            try:
                single_doi_label = self._record_service.create_doi_record(doi)

                # Validate the label representation of the DOI
                self._validator_service.validate(single_doi_label)

                # Validate the object representation of the DOI
                self._doi_validator.validate_update_request(doi)
            # Collect all warnings and exceptions so they can be combined into
            # a single WarningDOIException
            except (
                DuplicatedTitleDOIException,
                InvalidIdentifierException,
                UnexpectedDOIActionException,
                TitleDoesNotMatchProductTypeException,
            ) as err:
                (exception_classes, exception_messages) = collect_exception_classes_and_messages(
                    err, exception_classes, exception_messages
                )

        # If there is at least one exception caught, either raise a
        # WarningDOIException or log a warning with all the messages,
        # depending on the the state of the force flag
        if len(exception_classes) > 0:
            raise_or_warn_exceptions(exception_classes, exception_messages, log=self._force)

        return dois

        Validates the list of DOI objects prior to their submission.

        Depending on the configuration of the DOI service, DOI objects may
        be validated against a schema as well as the internal checks performed
        by the validator class.

        Any exceptions or warnings encountered during the checks are stored
        until all DOI's have been checked. Depending on the state of the
        force flag, these collected exceptions are either raised as a single
        exception, or simply logged.

        Parameters
        ----------
        dois : list of Doi
            The DOI objects to validate.

        Returns
        -------
        dois : list of Doi
            The validated list of DOI objects.

        
Validates the list of DOI objects prior to their submission.
Depending on the configuration of the DOI service, DOI objects may
be validated against a schema as well as the internal checks performed
by the validator class.

Any exceptions or warnings encountered during the checks are stored
until all DOI's have been checked. Depending on the state of the
force flag, these collected exceptions are either raised as a single
exception, or simply logged.

Parameters

dois : list of Doi
The DOI objects to validate.

Returns

dois : list of Doi
The validated list of DOI objects.
Validates the list of DOI objects prior to their submission . Depending on the configuration of the DOI service DOI objects may be validated against a schema as well as the internal checks performed by the validator class . Any exceptions or warnings encountered during the checks are stored until all DOI ' s have been checked . Depending on the state of the force flag these collected exceptions are either raised as a single exception or simply logged . Parameters dois : list of Doi The DOI objects to validate . Returns dois : list of Doi The validated list of DOI objects .
def _validate_dois(self, dois):
        exception_classes = []
        exception_messages = []
        for doi in dois:
            try:
                single_doi_label = self._record_service.create_doi_record(doi)
                self._validator_service.validate(single_doi_label)
                self._doi_validator.validate_update_request(doi)
            except (
                DuplicatedTitleDOIException,
                InvalidIdentifierException,
                UnexpectedDOIActionException,
                TitleDoesNotMatchProductTypeException,
            ) as err:
                (exception_classes, exception_messages) = collect_exception_classes_and_messages(
                    err, exception_classes, exception_messages
                )
        if len(exception_classes) > 0:
            raise_or_warn_exceptions(exception_classes, exception_messages, log=self._force)
        return dois
def _validate_dois ( self , dois ) : exception_classes = [ ] exception_messages = [ ] for doi in dois : try : single_doi_label = self . _record_service . create_doi_record ( doi ) self . _validator_service . validate ( single_doi_label ) self . _doi_validator . validate_update_request ( doi ) except ( DuplicatedTitleDOIException , InvalidIdentifierException , UnexpectedDOIActionException , TitleDoesNotMatchProductTypeException , ) as err : ( exception_classes , exception_messages ) = collect_exception_classes_and_messages ( err , exception_classes , exception_messages ) if len ( exception_classes ) > 0 : raise_or_warn_exceptions ( exception_classes , exception_messages , log = self . _force ) return dois
Validates the list of DOI objects prior to their submission.
Validates the list of DOI objects prior to their submission .
"""
        Validates the list of DOI objects prior to their submission.

        Depending on the configuration of the DOI service, DOI objects may
        be validated against a schema as well as the internal checks performed
        by the validator class.

        Any exceptions or warnings encountered during the checks are stored
        until all DOI's have been checked. Depending on the state of the
        force flag, these collected exceptions are either raised as a single
        exception, or simply logged.

        Parameters
        ----------
        dois : list of Doi
            The DOI objects to validate.

        Returns
        -------
        dois : list of Doi
            The validated list of DOI objects.

        """ # Validate the label representation of the DOI # Validate the object representation of the DOI # Collect all warnings and exceptions so they can be combined into # a single WarningDOIException # If there is at least one exception caught, either raise a # WarningDOIException or log a warning with all the messages, # depending on the the state of the force flag
self
dois