diff --git a/readux_ingest_ecds/models.py b/readux_ingest_ecds/models.py index 479087c..c98870e 100644 --- a/readux_ingest_ecds/models.py +++ b/readux_ingest_ecds/models.py @@ -194,7 +194,7 @@ def create_canvases(self): except IndexError: ocr_file_path = None - new_canvases.append(Canvas( + new_canvas = Canvas( manifest=self.manifest, image_server=self.image_server, pid=canvas_pid, @@ -202,7 +202,11 @@ def create_canvases(self): position=position, width=width, height=height - )) + ) + + new_canvas.before_save() + + new_canvases.append(new_canvas) Canvas.objects.bulk_create(new_canvases) diff --git a/test_app/iiif/models.py b/test_app/iiif/models.py index 511b385..5fead05 100644 --- a/test_app/iiif/models.py +++ b/test_app/iiif/models.py @@ -57,6 +57,9 @@ class Canvas(models.Model): default_ocr = models.CharField(max_length=30, choices=preferred_ocr, default="word") image_server = models.ForeignKey(ImageServer, on_delete=models.DO_NOTHING, null=True) + def before_save(self): + return True + class OCR(models.Model): OCR = 'cnt:ContentAsText' TEXT = 'dctypes:Text'