From 12bcf355a7a4a940ff91a645732989dbbd7f0d82 Mon Sep 17 00:00:00 2001 From: Geert Kapteijns <ghkapteijns@gmail.com> Date: Mon, 15 May 2017 14:27:32 +0200 Subject: [PATCH] format author_list before prefilling form --- commentaries/forms.py | 2 ++ commentaries/views.py | 2 +- scipost/test_services.py | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commentaries/forms.py b/commentaries/forms.py index be071a9fb..f3b768510 100644 --- a/commentaries/forms.py +++ b/commentaries/forms.py @@ -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} diff --git a/commentaries/views.py b/commentaries/views.py index aace26ae6..b8eb6d4e4 100644 --- a/commentaries/views.py +++ b/commentaries/views.py @@ -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( diff --git a/scipost/test_services.py b/scipost/test_services.py index 4202d7f52..c32d41cc8 100644 --- a/scipost/test_services.py +++ b/scipost/test_services.py @@ -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', -- GitLab