diff --git a/arkindex_worker/worker/classification.py b/arkindex_worker/worker/classification.py index 6d356c3902a1cfd179bde47dec361e654d5fe46a..9e5d95c7d84043cfba13368c6d2a583ae5903644 100644 --- a/arkindex_worker/worker/classification.py +++ b/arkindex_worker/worker/classification.py @@ -132,6 +132,8 @@ class ClassificationMixin(object): self.report.add_classification(element.id, ml_class) + return created + def create_classifications(self, element, classifications): """ Create multiple classifications at once on the given element through the API @@ -199,3 +201,5 @@ class ClassificationMixin(object): logger.warning( f"Couldn't save created classifications in local cache: {e}" ) + + return created_cls diff --git a/arkindex_worker/worker/entity.py b/arkindex_worker/worker/entity.py index 7dd5e85d294987701e258fee0869917cc7507128..1cf561658d1769ea9ca8aa96db0b376206acbb6d 100644 --- a/arkindex_worker/worker/entity.py +++ b/arkindex_worker/worker/entity.py @@ -104,7 +104,7 @@ class EntityMixin(object): ) return - self.request( + transcription_ent = self.request( "CreateTranscriptionEntity", id=transcription, body={ @@ -130,3 +130,4 @@ class EntityMixin(object): logger.warning( f"Couldn't save created transcription entity in local cache: {e}" ) + return transcription_ent diff --git a/arkindex_worker/worker/transcription.py b/arkindex_worker/worker/transcription.py index d89c1425f69bf765a324d67b51188f1a0955fa9b..388f756c7d094320fb482fbc35d31def103b0cce 100644 --- a/arkindex_worker/worker/transcription.py +++ b/arkindex_worker/worker/transcription.py @@ -59,6 +59,8 @@ class TranscriptionMixin(object): f"Couldn't save created transcription in local cache: {e}" ) + return created + def create_transcriptions(self, transcriptions): """ Create multiple transcriptions at once on existing elements through the API. @@ -114,6 +116,8 @@ class TranscriptionMixin(object): f"Couldn't save created transcriptions in local cache: {e}" ) + return created_trs + def create_element_transcriptions(self, element, sub_element_type, transcriptions): """ Create multiple sub elements with their transcriptions on the given element through API