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
f6a52edb
Commit
f6a52edb
authored
1 year ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
Partially resolves
nacsos-web#39
parent
6e5a03d5
No related branches found
No related tags found
1 merge request
!36
Master
Pipeline
#1255
passed
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/project/items.py
+2
-2
2 additions, 2 deletions
server/api/routes/project/items.py
with
2 additions
and
2 deletions
server/api/routes/project/items.py
+
2
−
2
View file @
f6a52edb
...
@@ -90,8 +90,8 @@ async def get_detail_for_item(item_id: str,
...
@@ -90,8 +90,8 @@ async def get_detail_for_item(item_id: str,
@router.get
(
'
/text/{item_id}
'
,
response_model
=
str
)
@router.get
(
'
/text/{item_id}
'
,
response_model
=
str
)
async
def
get_text_for_item
(
item_id
:
str
,
permission
=
Depends
(
UserPermissionChecker
(
'
dataset_read
'
)))
->
str
:
async
def
get_text_for_item
(
item_id
:
str
,
permission
=
Depends
(
UserPermissionChecker
(
'
dataset_read
'
)))
->
str
:
async
with
db_engine
.
session
()
as
session
:
async
with
db_engine
.
session
()
as
session
:
stmt
=
select
(
Item
.
text
).
where
(
Item
.
item_id
==
item_id
)
stmt
=
select
(
Item
.
text
).
where
(
Item
.
item_id
==
item_id
)
text
=
await
session
.
scalar
(
stmt
)
text
:
str
|
None
=
await
session
.
scalar
(
stmt
)
if
text
is
None
:
if
text
is
None
:
raise
ItemNotFoundError
(
f
'
No text available for item with ID:
{
item_id
}
'
)
raise
ItemNotFoundError
(
f
'
No text available for item with ID:
{
item_id
}
'
)
return
text
return
text
...
...
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