diff --git a/cl/corpus_importer/tasks.py b/cl/corpus_importer/tasks.py index 613be7be56..6d471b82f2 100644 --- a/cl/corpus_importer/tasks.py +++ b/cl/corpus_importer/tasks.py @@ -2231,7 +2231,11 @@ def update_rd_metadata( item=rd, ) if response.is_success: - rd.page_count = response.text + rd.page_count = int(response.text) + + assert isinstance( + rd.page_count, (int, type(None)) + ), "page_count must be an int or None." # Save and extract, skipping OCR. rd.save()