Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
804fef3f
Commit
804fef3f
authored
1 year ago
by
Valentin Rigal
Committed by
Erwan Rouchet
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Restrict usage of CreateTranscriptions
parent
1dcfba27
No related branches found
No related tags found
1 merge request
!1994
Restrict usage of CreateTranscriptions
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arkindex/documents/serializers/ml.py
+8
-6
8 additions, 6 deletions
arkindex/documents/serializers/ml.py
arkindex/documents/tests/test_bulk_transcriptions.py
+288
-116
288 additions, 116 deletions
arkindex/documents/tests/test_bulk_transcriptions.py
with
296 additions
and
122 deletions
arkindex/documents/serializers/ml.py
+
8
−
6
View file @
804fef3f
...
...
@@ -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.
Click to expand it.
arkindex/documents/tests/test_bulk_transcriptions.py
+
288
−
116
View file @
804fef3f
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment