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
bea803f0
Commit
bea803f0
authored
1 year ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
fix mypy
parent
91e3e623
No related branches found
No related tags found
1 merge request
!37
Master
Pipeline
#1296
passed
1 year ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/api/routes/annotations.py
+1
-1
1 addition, 1 deletion
server/api/routes/annotations.py
server/api/routes/highlight.py
+3
-6
3 additions, 6 deletions
server/api/routes/highlight.py
with
4 additions
and
7 deletions
server/api/routes/annotations.py
+
1
−
1
View file @
bea803f0
...
...
@@ -367,7 +367,7 @@ async def make_assignments(payload: MakeAssignmentsRequestModel,
assignments
=
await
random_assignments_with_exclusion
(
assignment_scope_id
=
payload
.
scope_id
,
annotation_scheme_id
=
payload
.
annotation_scheme_id
,
project_id
=
permissions
.
permissions
.
project_id
,
config
=
payload
.
config
,
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
,
...
...
This diff is collapsed.
Click to expand it.
server/api/routes/highlight.py
+
3
−
6
View file @
bea803f0
from
typing
import
TYPE_CHECKING
from
nacsos_data.util.auth
import
UserPermissions
from
pydantic
import
BaseModel
from
sqlalchemy
import
select
from
sqlalchemy.orm
import
load_only
from
fastapi
import
APIRouter
,
Depends
,
HTTPException
,
status
as
http_status
,
Query
from
fastapi
import
APIRouter
,
Depends
from
nacsos_data.db.schemas.annotations
import
AssignmentScope
from
nacsos_data.db.schemas.highlight
import
Highlighter
from
nacsos_data.models.highlight
import
HighlighterModel
from
server.api.errors
import
\
SaveFailedError
,
\
MissingInformationError
,
\
NoDataForKeyError
,
\
DataNotFoundWarning
from
server.util.security
import
UserPermissionChecker
,
InsufficientPermissions
...
...
@@ -75,6 +71,7 @@ async def upsert_highlighter(highlighter: HighlighterModel,
return
str
(
highlighter
.
highlighter_id
)
@router.get
(
'
/{highlighter_id}
'
,
response_model
=
HighlighterModel
|
None
)
async
def
get_highlighter
(
highlighter_id
:
str
,
permissions
:
UserPermissions
=
Depends
(
UserPermissionChecker
(
'
annotations_read
'
)))
\
...
...
@@ -86,4 +83,4 @@ async def get_highlighter(highlighter_id: str,
if
result
is
not
None
:
return
HighlighterModel
.
parse_obj
(
result
.
__dict__
)
raise
NoDataForKeyError
(
f
'
No highlighter in project
{
permissions
.
permissions
.
project_id
}
'
f
'
with id
{
highlighter_id
}
!
'
)
\ No newline at end of file
f
'
with id
{
highlighter_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