SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
55ea57d0
"README.rst" did not exist on "23b88ecaaff88cde9e827b89376bd65872276639"
Commit
55ea57d0
authored
7 years ago
by
Geert Kapteijns
Browse files
Options
Downloads
Patches
Plain Diff
move author list formatting to DOICaller
parent
12bcf355
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
commentaries/forms.py
+0
-2
0 additions, 2 deletions
commentaries/forms.py
scipost/services.py
+2
-0
2 additions, 0 deletions
scipost/services.py
scipost/test_services.py
+0
-39
0 additions, 39 deletions
scipost/test_services.py
with
2 additions
and
41 deletions
commentaries/forms.py
+
0
−
2
View file @
55ea57d0
...
...
@@ -36,7 +36,6 @@ class DOIToQueryForm(forms.Form):
def
request_published_article_form_prefill_data
(
self
):
additional_form_data
=
{
'
pub_DOI
'
:
self
.
cleaned_data
[
'
doi
'
]}
self
.
crossref_data
[
'
author_list
'
]
=
"
,
"
.
join
(
self
.
crossref_data
[
'
author_list
'
])
return
{
**
self
.
crossref_data
,
**
additional_form_data
}
...
...
@@ -67,7 +66,6 @@ class ArxivQueryForm(forms.Form):
def
request_arxiv_preprint_form_prefill_data
(
self
):
additional_form_data
=
{
'
arxiv_identifier
'
:
self
.
cleaned_data
[
'
identifier
'
]}
self
.
arxiv_data
[
'
author_list
'
]
=
"
,
"
.
join
(
self
.
arxiv_data
[
'
author_list
'
])
return
{
**
self
.
arxiv_data
,
**
additional_form_data
}
...
...
This diff is collapsed.
Click to expand it.
scipost/services.py
+
2
−
0
View file @
55ea57d0
...
...
@@ -31,6 +31,8 @@ class DOICaller:
data
=
self
.
_crossref_data
pub_title
=
data
[
'
title
'
][
0
]
author_list
=
[
'
{} {}
'
.
format
(
author
[
'
given
'
],
author
[
'
family
'
])
for
author
in
data
[
'
author
'
]]
# author_list is given as a comma separated list of names on the relevant models (Commentary, Submission)
author_list
=
"
,
"
.
join
(
author_list
)
journal
=
data
[
'
container-title
'
][
0
]
volume
=
data
.
get
(
'
volume
'
,
''
)
pages
=
self
.
_get_pages
(
data
)
...
...
This diff is collapsed.
Click to expand it.
scipost/test_services.py
+
0
−
39
View file @
55ea57d0
...
...
@@ -60,42 +60,3 @@ class DOICallerTest(TestCase):
def
test_valid_but_non_existent_doi
(
self
):
caller
=
DOICaller
(
'
10.21468/NonExistentJournal.2.2.012
'
)
self
.
assertEqual
(
caller
.
is_valid
,
False
)
# class ArxivCallerTestOld(TestCase):
# def test_correct_lookup(self):
# caller = ArxivCaller(Submission, '1611.09574v1')
#
# caller.process()
#
# self.assertEqual(caller.is_valid(), True)
# self.assertIn('entries', caller.metadata)
#
# def test_errorcode_for_non_existing_paper(self):
# caller = ArxivCaller(Submission, '2611.09574v1')
#
# caller.process()
# self.assertEqual(caller.is_valid(), False)
# self.assertEqual(caller.errorcode, 'preprint_does_not_exist')
#
# def test_errorcode_for_bad_request(self):
# caller = ArxivCaller(Submission, '161109574v1')
#
# caller.process()
# self.assertEqual(caller.is_valid(), False)
# self.assertEqual(caller.errorcode, 'arxiv_bad_request')
#
# def test_errorcode_for_already_published_journal_ref(self):
# caller = ArxivCaller(Submission, '1412.0006v1')
#
# caller.process()
# self.assertEqual(caller.is_valid(), False)
# self.assertEqual(caller.errorcode, 'paper_published_journal_ref')
# self.assertNotEqual(caller.arxiv_journal_ref, '')
#
# def test_errorcode_no_version_nr(self):
# # Should be already caught in form validation
# caller = ArxivCaller(Submission, '1412.0006')
#
# caller.process()
# self.assertEqual(caller.is_valid(), False)
# self.assertEqual(caller.errorcode, 'bad_identifier')
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