From 5ebaf570a5378174a72527ed2128a49b19bae4af Mon Sep 17 00:00:00 2001 From: David Manthey Date: Thu, 1 Sep 2022 11:53:26 -0400 Subject: [PATCH] Fix checking user annotation document length --- CHANGELOG.md | 1 + .../girder_large_image_annotation/models/annotationelement.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01233b6b9..04a0f7b8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Bug Fixes - Harden adding images to the item list ([955](../../pull/955)) +- Fix checking user annotation document length ([956](../../pull/956)) ## 1.16.2 diff --git a/girder_annotation/girder_large_image_annotation/models/annotationelement.py b/girder_annotation/girder_large_image_annotation/models/annotationelement.py index 13f63bca5..be92309c5 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotationelement.py +++ b/girder_annotation/girder_large_image_annotation/models/annotationelement.py @@ -551,7 +551,7 @@ def updateElementChunk(self, elements, chunk, chunkSize, annotation, now): if (len(entries) == 1 and (len(entries[0]['element'].get( 'points', entries[0]['element'].get('values', []))) > MAX_ELEMENT_DOCUMENT or ( 'user' in entries[0]['element'] and - len(pickle.dumps(entries[0]['element'], protocol=4) > MAX_ELEMENT_USER_DOCUMENT)))): + len(pickle.dumps(entries[0]['element'], protocol=4)) > MAX_ELEMENT_USER_DOCUMENT))): self.saveElementAsFile(annotation, entries) res = self.collection.insert_many(entries, ordered=False) for pos, entry in enumerate(entries):