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
1ccfc991
Verified
Commit
1ccfc991
authored
1 year ago
by
Erwan Rouchet
Browse files
Options
Downloads
Patches
Plain Diff
Fix stale read and extra query on element image on CreateElementTranscriptions
parent
fe8925de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1971
Fix stale read and extra query on element image on CreateElementTranscriptions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arkindex/documents/api/ml.py
+1
-1
1 addition, 1 deletion
arkindex/documents/api/ml.py
arkindex/documents/tests/test_bulk_element_transcriptions.py
+11
-11
11 additions, 11 deletions
arkindex/documents/tests/test_bulk_element_transcriptions.py
with
12 additions
and
12 deletions
arkindex/documents/api/ml.py
+
1
−
1
View file @
1ccfc991
...
...
@@ -183,7 +183,7 @@ class ElementTranscriptionsBulk(CreateAPIView):
# and this endpoint is immediately used after to create transcriptions
return
Element
.
objects
.
filter
(
corpus__in
=
Corpus
.
objects
.
writable
(
self
.
request
.
user
)
).
using
(
'
default
'
).
select_related
(
'
corpus
'
)
).
using
(
'
default
'
).
select_related
(
'
corpus
'
,
'
image
'
)
def
get_serializer_context
(
self
):
context
=
super
().
get_serializer_context
()
...
...
This diff is collapsed.
Click to expand it.
arkindex/documents/tests/test_bulk_element_transcriptions.py
+
11
−
11
View file @
1ccfc991
...
...
@@ -88,7 +88,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
for
poly
,
text
,
confidence
,
orientation
in
transcriptions
]
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
page
.
id
}),
format
=
'
json
'
,
...
...
@@ -148,7 +148,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
for
poly
,
text
,
confidence
,
orientation
,
element_confidence
in
transcriptions
]
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
page
.
id
}),
format
=
'
json
'
,
...
...
@@ -209,7 +209,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
self
.
assertEqual
(
created_elts
.
count
(),
1
)
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
page
.
id
}),
format
=
'
json
'
,
...
...
@@ -251,7 +251,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
page
.
id
}),
format
=
'
json
'
,
...
...
@@ -300,7 +300,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
4
):
with
self
.
assertNumQueries
(
1
3
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
huge_page
.
id
}),
format
=
'
json
'
,
...
...
@@ -467,7 +467,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
page
.
id
}),
format
=
'
json
'
,
...
...
@@ -534,7 +534,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
for
poly
,
text
,
confidence
in
transcriptions
]
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
top_level
.
id
}),
format
=
'
json
'
,
...
...
@@ -582,7 +582,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
for
poly
,
text
,
confidence
in
transcriptions
]
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
page
.
id
}),
format
=
'
json
'
,
...
...
@@ -645,7 +645,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
for
poly
,
text
,
confidence
in
transcriptions
]
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
rotated_page
.
id
}),
format
=
'
json
'
,
...
...
@@ -682,7 +682,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
for
poly
,
text
,
confidence
in
transcriptions
]
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
6
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
mirrored_page
.
id
}),
format
=
'
json
'
,
...
...
@@ -719,7 +719,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
}
for
poly
,
text
,
confidence
in
transcriptions
]
}
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
8
):
with
self
.
assertNumQueries
(
7
):
response
=
self
.
client
.
post
(
reverse
(
'
api:element-transcriptions-bulk
'
,
kwargs
=
{
'
pk
'
:
self
.
page
.
id
}),
format
=
'
json
'
,
...
...
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