add re-validation in python
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from submissions.utils import verify_and_validate_ocr_date_for_submission
|
||||
from submissions.models import SubmissionFile
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument("--force", action="store_true", help="Force redo the OCR")
|
||||
|
||||
def handle(self, *args, **options):
|
||||
for file in SubmissionFile.objects.prefetch_related(
|
||||
"response__puzzle",
|
||||
"response__submission__user",
|
||||
):
|
||||
if not file.response.needs_manual_validation and not options.get(
|
||||
"force", False
|
||||
):
|
||||
continue
|
||||
|
||||
verify_and_validate_ocr_date_for_submission(file)
|
||||
Reference in New Issue
Block a user