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
3c830404
Commit
3c830404
authored
9 months ago
by
ml bonhomme
Committed by
Erwan Rouchet
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove worker version from bulk transcriptions endpoint
parent
d7d87076
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2380
Remove worker version from bulk transcriptions endpoint
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arkindex/documents/serializers/ml.py
+0
-1
0 additions, 1 deletion
arkindex/documents/serializers/ml.py
arkindex/documents/tests/test_bulk_element_transcriptions.py
+0
-26
0 additions, 26 deletions
arkindex/documents/tests/test_bulk_element_transcriptions.py
with
0 additions
and
27 deletions
arkindex/documents/serializers/ml.py
+
0
−
1
View file @
3c830404
...
...
@@ -378,7 +378,6 @@ class ElementTranscriptionsBulkSerializer(serializers.Serializer):
slug_field
=
"
slug
"
,
help_text
=
"
An ElementType slug used to create all sub elements. Only one type is allowed per request
"
)
worker_version
=
ForbiddenField
()
worker_run_id
=
WorkerRunIDField
(
help_text
=
dedent
(
"""
A WorkerRun ID that the new elements and transcriptions will refer to.
...
...
This diff is collapsed.
Click to expand it.
arkindex/documents/tests/test_bulk_element_transcriptions.py
+
0
−
26
View file @
3c830404
...
...
@@ -40,7 +40,6 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
def
test_bulk_transcriptions_worker_version
(
self
):
data
=
{
"
element_type
"
:
"
text_line
"
,
"
worker_version
"
:
str
(
self
.
worker_version
.
id
),
"
transcriptions
"
:
[
{
"
polygon
"
:
[[
13
,
37
],
[
133
,
37
],
[
133
,
137
],
[
13
,
137
],
[
13
,
37
]],
...
...
@@ -60,7 +59,6 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
self
.
assertEqual
(
response
.
json
(),
{
"
worker_run_id
"
:
[
"
This field is required.
"
],
"
worker_version
"
:
[
"
This field is forbidden.
"
],
})
def
test_bulk_transcriptions_worker_run
(
self
):
...
...
@@ -369,28 +367,6 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
"
worker_run_id
"
:
[
"
This field is required.
"
],
})
def
test_bulk_transcriptions_version_xor_run
(
self
):
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
5
):
response
=
self
.
client
.
post
(
reverse
(
"
api:element-transcriptions-bulk
"
,
kwargs
=
{
"
pk
"
:
self
.
page
.
id
}),
format
=
"
json
"
,
data
=
{
"
worker_version
"
:
str
(
self
.
custom_version
.
id
),
"
worker_run_id
"
:
str
(
self
.
local_worker_run
.
id
),
"
element_type
"
:
"
text_line
"
,
"
transcriptions
"
:
[{
"
polygon
"
:
[[
13
,
37
],
[
133
,
37
],
[
133
,
137
],
[
13
,
137
],
[
13
,
37
]],
"
text
"
:
"
Can I write womething here ?
"
,
"
confidence
"
:
.
666
}]
}
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
self
.
assertDictEqual
(
response
.
json
(),
{
"
worker_version
"
:
[
"
This field is forbidden.
"
],
})
def
test_bulk_transcriptions_wrong_fields_validation
(
self
):
"""
Briefly assert fields values are validated
...
...
@@ -403,7 +379,6 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
format
=
"
json
"
,
data
=
{
"
element_type
"
:
"
paragraph
"
,
"
worker_version
"
:
bad_id
,
"
worker_run_id
"
:
bad_id
,
"
transcriptions
"
:
[
{
...
...
@@ -425,7 +400,6 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
self
.
assertDictEqual
(
response
.
json
(),
{
"
element_type
"
:
[
"
Object with slug=paragraph does not exist.
"
],
"
worker_version
"
:
[
"
This field is forbidden.
"
],
"
worker_run_id
"
:
[
f
'
Invalid pk
"
{
bad_id
}
"
- object does not exist.
'
],
"
transcriptions
"
:
[
{
...
...
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