SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 12bcf355 authored by Geert Kapteijns's avatar Geert Kapteijns
Browse files

format author_list before prefilling form

parent 6513a2c9
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ 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}
......@@ -66,6 +67,7 @@ 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}
......
......@@ -45,7 +45,7 @@ class RequestPublishedArticle(CreateView):
def form_valid(self, form):
messages.success(self.request, strings.acknowledge_request_commentary)
return super(RequestArxivPreprint, self).form_valid(form)
return super(RequestPublishedArticle, self).form_valid(form)
@method_decorator(permission_required(
......
......@@ -49,8 +49,6 @@ class DOICallerTest(TestCase):
correct_data = {
'pub_date': '2017-04-04',
'journal': 'SciPost Physics',
# Inexplicably, an extra space is added between 'inpenetrable' and 'bosons', but this is a
# Crossref error.
'pub_title': 'One-particle density matrix of trapped one-dimensional impenetrable bosons from conformal invariance',
'pages': '',
'volume': '2',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment