Skip to content
Snippets Groups Projects
Commit 804fef3f authored by Valentin Rigal's avatar Valentin Rigal Committed by Erwan Rouchet
Browse files

Restrict usage of CreateTranscriptions

parent 1dcfba27
No related branches found
No related tags found
1 merge request!1994Restrict usage of CreateTranscriptions
......@@ -19,7 +19,6 @@ from arkindex.documents.models import (
Transcription,
)
from arkindex.documents.serializers.light import ElementZoneSerializer
from arkindex.process.models import WorkerRun
from arkindex.project.serializer_fields import EnumField, ForbiddenField, LinearRingField, WorkerRunIDField
from arkindex.project.tools import polygon_outside_image
from arkindex.project.validators import ConditionalUniqueValidator, ForbiddenValidator
......@@ -467,11 +466,14 @@ class TranscriptionBulkItemSerializer(serializers.Serializer):
class TranscriptionBulkSerializer(serializers.Serializer):
worker_version = ForbiddenField()
worker_run_id = serializers.PrimaryKeyRelatedField(
queryset=WorkerRun.objects.all(),
help_text='A WorkerRun ID that transcriptions will refer to.',
style={'base_template': 'input.html'},
source='worker_run',
worker_run_id = WorkerRunIDField(
help_text=dedent("""
A WorkerRun ID that the new transcriptions will refer to.
Regular users may only use the WorkerRuns of their own `Local` process.
Tasks authenticated via the Ponos task authentication may only use the WorkerRuns of their process.
""").strip(),
)
transcriptions = TranscriptionBulkItemSerializer(many=True)
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment