Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
49b2fba4
Commit
49b2fba4
authored
Oct 06, 2021
by
Markus Scheidgen
Browse files
Merge branch 'v1.0.0_issue610' into 'v1.0.0'
Move POST datasets/{id}/doi to datasets/{id}/action/doi See merge request
!403
parents
994a0359
6ecf9ba1
Pipeline
#111983
passed with stages
in 35 minutes and 50 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gui/src/components/dataset/DatasetsPage.js
View file @
49b2fba4
...
...
@@ -59,7 +59,7 @@ const DatasetActions = React.memo(function VisitDatasetAction({data}) {
},
[
api
,
raiseError
,
data
.
dataset_id
,
refresh
])
const
handleAssignDoi
=
useCallback
(()
=>
{
api
.
post
(
`/datasets/
${
data
.
dataset_id
}
/doi`
)
api
.
post
(
`/datasets/
${
data
.
dataset_id
}
/
action/
doi`
)
.
then
(
refresh
).
catch
(
raiseError
)
},
[
api
,
raiseError
,
data
.
dataset_id
,
refresh
])
...
...
nomad/app/v1/routers/datasets.py
View file @
49b2fba4
...
...
@@ -331,7 +331,7 @@ async def delete_dataset(
@
router
.
post
(
'/{dataset_id}/doi'
,
tags
=
[
default_tag
],
'/{dataset_id}/
action/
doi'
,
tags
=
[
default_tag
],
summary
=
'Assign a DOI to a dataset'
,
response_model
=
DatasetResponse
,
responses
=
create_responses
(
_bad_id_response
,
_dataset_is_fixed_response
,
_bad_user_response
),
...
...
nomad/cli/client/integrationtests.py
View file @
49b2fba4
...
...
@@ -195,7 +195,7 @@ def integrationtests(auth: api.Auth, skip_parsers: bool, skip_publish: bool, ski
if
not
skip_doi
and
published
:
print
(
'assigning a DOI'
)
response
=
api
.
post
(
f
'datasets/
{
dataset_id
}
/doi'
,
auth
=
auth
)
response
=
api
.
post
(
f
'datasets/
{
dataset_id
}
/
action/
doi'
,
auth
=
auth
)
assert
response
.
status_code
==
200
,
response
.
text
has_doi
=
True
...
...
tests/app/v1/routers/test_datasets.py
View file @
49b2fba4
...
...
@@ -284,7 +284,7 @@ def test_assign_doi_dataset(client, data, test_user, test_user_auth, other_test_
if
user
==
'other_test_user'
:
auth
=
other_test_user_auth
response
=
client
.
post
(
'datasets/%s/doi'
%
dataset_id
,
headers
=
auth
)
'datasets/%s/
action/
doi'
%
dataset_id
,
headers
=
auth
)
assert_response
(
response
,
status_code
=
status_code
)
if
status_code
!=
200
:
...
...
tests/app/v1/routers/test_entries_edit.py
View file @
49b2fba4
...
...
@@ -250,7 +250,7 @@ class TestEditRepo():
datasets
=
[
self
.
example_dataset
.
name
],
query
=
self
.
query
(
'upload_1'
))
assert
rv
.
status_code
==
200
rv
=
self
.
api
.
post
(
'datasets/%s/doi'
%
self
.
example_dataset
.
name
,
headers
=
self
.
test_user_auth
)
rv
=
self
.
api
.
post
(
'datasets/%s/
action/
doi'
%
self
.
example_dataset
.
name
,
headers
=
self
.
test_user_auth
)
assert
rv
.
status_code
==
200
rv
=
self
.
perform_edit
(
datasets
=
[],
query
=
self
.
query
(
'upload_1'
))
assert
rv
.
status_code
==
400
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment