Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
NACSOS Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MCC APSIS
NACSOS
NACSOS Core
Commits
f0a82307
Commit
f0a82307
authored
1 year ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
assignment with nql
parent
f5af7cc0
No related branches found
No related tags found
1 merge request
!77
Master
Pipeline
#2560
failed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/api/routes/annotations.py
+12
-0
12 additions, 0 deletions
server/api/routes/annotations.py
with
12 additions
and
0 deletions
server/api/routes/annotations.py
+
12
−
0
View file @
f0a82307
...
...
@@ -73,6 +73,7 @@ from nacsos_data.util.annotations.validation import (
)
from
nacsos_data.util.annotations.assignments.random
import
random_assignments
from
nacsos_data.util.annotations.assignments.random_exclusion
import
random_assignments_with_exclusion
from
nacsos_data.util.annotations.assignments.random_nql
import
random_assignments_with_nql
from
server.api.errors
import
(
SaveFailedError
,
...
...
@@ -389,6 +390,17 @@ async def make_assignments(payload: MakeAssignmentsRequestModel,
except
ValueError
as
e
:
raise
HTTPException
(
status_code
=
http_status
.
HTTP_400_BAD_REQUEST
,
detail
=
str
(
e
))
elif
payload
.
config
.
config_type
==
'
random_nql
'
:
try
:
assignments
=
await
random_assignments_with_nql
(
assignment_scope_id
=
payload
.
scope_id
,
annotation_scheme_id
=
payload
.
annotation_scheme_id
,
project_id
=
permissions
.
permissions
.
project_id
,
config
=
payload
.
config
,
# type: ignore[arg-type] # FIXME
engine
=
db_engine
)
except
ValueError
as
e
:
raise
HTTPException
(
status_code
=
http_status
.
HTTP_400_BAD_REQUEST
,
detail
=
str
(
e
))
else
:
raise
HTTPException
(
status_code
=
http_status
.
HTTP_501_NOT_IMPLEMENTED
,
detail
=
f
'
Method
"
{
payload
.
config
.
config_type
}
"
is unknown.
'
)
...
...
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