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
3f2fced9
Commit
3f2fced9
authored
2 years ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
handle next assignment endpoint for 'all done'
parent
cf082565
No related branches found
No related tags found
1 merge request
!21
Deploy deletion cascades & pipeline integration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/api/routes/annotations.py
+14
-1
14 additions, 1 deletion
server/api/routes/annotations.py
with
14 additions
and
1 deletion
server/api/routes/annotations.py
+
14
−
1
View file @
3f2fced9
...
...
@@ -172,13 +172,26 @@ async def get_next_assignment_for_scope_for_user(assignment_scope_id: str,
return
await
_construct_annotation_item
(
assignment
=
assignment
,
project_id
=
permissions
.
permissions
.
project_id
)
class
NoAssignments
(
Warning
):
pass
@router.get
(
'
/annotate/next/{assignment_scope_id}
'
,
response_model
=
AnnotationItem
)
async
def
get_next_open_assignment_for_scope_for_user
(
assignment_scope_id
:
str
,
permissions
=
Depends
(
UserPermissionChecker
(
'
annotations_read
'
))):
# FIXME response for "all done"
assignment
=
await
read_next_open_assignment_for_scope_for_user
(
assignment_scope_id
=
assignment_scope_id
,
user_id
=
permissions
.
user
.
user_id
,
db_engine
=
db_engine
)
# Either there are no assignments, or everything is done.
if
assignment
is
None
:
assignments
=
await
read_assignments_for_scope_for_user
(
assignment_scope_id
=
assignment_scope_id
,
user_id
=
permissions
.
user
.
user_id
,
db_engine
=
db_engine
,
limit
=
1
)
if
len
(
assignments
)
>
0
:
assignment
=
assignments
[
0
]
else
:
raise
NoAssignments
(
'
This user has no assignments in this scope.
'
)
return
await
_construct_annotation_item
(
assignment
=
assignment
,
project_id
=
permissions
.
permissions
.
project_id
)
...
...
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