def update( self, data, disable_external_push=False, disable_relations_update=False, *args, **kwargs, ): with db.session.begin_nested(): LiteratureRecord.update_authors_signature_blocks_and_uuids(data) LiteratureRecord.update_refs_to_conferences(data) data = self.add_files(data) super().update(data, *args, **kwargs) if not disable_relations_update: self.update_record_relationships() if disable_external_push: LOGGER.info( "Record EXTERNAL PUSH disabled", recid=self.get("control_number"), uuid=str(self.id), ) else: push_to_orcid(self) push_to_hal(self) self.push_authors_phonetic_blocks_to_redis()
def update( self, data, disable_external_push=False, disable_relations_update=False, disable_disambiguation=False, *args, **kwargs, ): with db.session.begin_nested(): LiteratureRecord.update_authors_signature_blocks_and_uuids(data) LiteratureRecord.update_refs_to_conferences(data) data = self.add_files(data) super().update(data, *args, **kwargs) if not disable_relations_update: self.update_record_relationships() if disable_external_push: LOGGER.info( "Record EXTERNAL PUSH disabled", recid=self.get("control_number"), uuid=str(self.id), ) else: push_to_orcid(self) push_to_hal(self) if (not disable_disambiguation and current_app.config["FEATURE_FLAG_ENABLE_AUTHOR_DISAMBIGUATION"] ): disambiguate_authors.delay(str(self.id)) self.push_authors_phonetic_blocks_to_redis()
def run_hal_push(uuids): for uuid in uuids: try: record = InspireRecord.get_record(uuid) if isinstance(record, LiteratureRecord): push_to_hal(record) except Exception: LOGGER.exception("Cannot push to hal", uuid=str(uuid)) return uuids