def save_publication(self, project_id, entity_uuids=None, revision=None, revised_authors=None): """Save publication. This task will create a draft DOI and copy all metadata to ES. For project types other than 'Other' a main entity uuid *must* be given. :param str project_id: Project Id. :param list of entity_uuid strings: Main entity uuid. """ from designsafe.apps.projects.managers import publication as PublicationManager try: PublicationManager.draft_publication(project_id, entity_uuids, revision=revision, revised_authors=revised_authors) # TODO: Why are we running this here if we're already calling it in the task chain? PublicationManager.freeze_project_and_entity_metadata( project_id, entity_uuids, revision=revision, revised_authors=revised_authors) except Exception as exc: logger.error('Proj Id: %s. %s', project_id, exc, exc_info=True) raise self.retry(exc=exc)
def freeze_publication_meta(self, project_id, entity_uuids=None): """Freeze publication meta. :param str project_id: Project Id. :param str entity_uuid: Entity uuid. """ from designsafe.apps.projects.managers import publication as PublicationManager try: PublicationManager.freeze_project_and_entity_metadata( project_id, entity_uuids) except Exception as exc: logger.error('Proj Id: %s. %s', project_id, exc, exc_info=True) raise self.retry(exc=exc)
def save_publication(self, project_id, entity_uuids=None): """Save publication. This task will create a draft DOI and copy all metadata to ES. For project types other than 'Other' a main entity uuid *must* be given. :param str project_id: Project Id. :param list of entity_uuid strings: Main entity uuid. """ from designsafe.apps.projects.managers import publication as PublicationManager try: PublicationManager.draft_publication(project_id, entity_uuids) PublicationManager.freeze_project_and_entity_metadata( project_id, entity_uuids) except Exception as exc: logger.error('Proj Id: %s. %s', project_id, exc, exc_info=True) raise self.retry(exc=exc)