Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes two issues related to prepublication author and reviewer notifications #4478

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/journal/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def handle_unassign_issue(request, article, issues):

def get_initial_for_prepub_notifications(request, article):
author_initial = {}
author_initial['to'] = article.correspondence_author.email
author_initial['to'] = article.correspondence_author.email if article.correspondence_author else None
cc = [au.email for au in article.non_correspondence_authors()]
notify_section_editors = request.journal.get_setting(
'general',
Expand All @@ -265,7 +265,7 @@ def get_initial_for_prepub_notifications(request, article):
'notify_peer_reviewers_of_publication',
)

if not notify_peer_reviewers:
if not notify_peer_reviewers or not article.peer_reviewers():
return [author_initial]
else:
peer_reviewer_initial = {}
Expand Down
2 changes: 1 addition & 1 deletion src/submission/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ def non_correspondence_authors(self):
if self.correspondence_author:
return self.authors.exclude(pk=self.correspondence_author.pk)
else:
return self.authors
return self.authors.all()

def is_accepted(self):
if self.date_published:
Expand Down
71 changes: 71 additions & 0 deletions src/templates/admin/elements/publish/warnings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<ul>
{% if journal_settings.general.abstract_required and not article.abstract %}
<li>
This journal requires article to have an abstract - this article does not
have one
<a
target="_blank"
href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}"
>[change]<span class="show-for-sr"> Opens in new tab</span></a
>
</li>
{% endif %}
<li>
This article has been marked as {% if not article.peer_reviewed %}not {% endif %}peer reviewed
<a
target="_blank"
href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}"
>[change]<span class="show-for-sr"> Opens in new tab</span></a
>
{% if not article.get_doi %}
</li>
<li>
No DOI has been assigned
<a target="_blank" href="{% url 'edit_identifiers' article.pk %}"
>[change]<span class="show-for-sr"> Opens in new tab</span></a
>
</li>
{% endif %} {% if not article.keywords.count > 0 %}
<li>
No keywords have been set
<a
target="_blank"
href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}"
>[change]<span class="show-for-sr"> Opens in new tab</span></a
>
</li>
{% endif %} {% if not article.issues_list.count > 0 %}
<li>
This article has not been assigned to an Issue yet{% if article.projected_issue %}
It was projected to be in {{ article.projected_issue }}{% endif %}
<a href="?m=issue">[change]</a>
</li>
{% endif %} {% if not article.license %}
<li>
No license has been set
<a
target="_blank"
href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}"
>[change]<span class="show-for-sr"> Opens in new tab</span></a
>.
</li>
{% endif %} {% if article.license and not article.license.url %}
<li>
The set license has no URL
<a
target="_blank"
href="{% url 'submission_licenses_id' article.license.pk %}"
>[edit license]<span class="show-for-sr"> Opens in new tab</span></a
>.
</li>
{% endif %} {% if not article.correspondence_author %}
<li>
No correspondence author has been set
<a
target="_blank"
href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}#edit-metadata-authors"
>[change]<span class="show-for-sr"> Opens in new tab</span></a
>.
</li>
{% endif %}
</ul>
11 changes: 1 addition & 10 deletions src/templates/admin/journal/publish_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,7 @@ <h2>Confirm Article Set for Publication</h2>

<div class="bs-callout bs-callout-danger">
<p><strong><span class="fa fa-warning"> </span> Warnings</strong></p>
<ul>
{% if journal_settings.general.abstract_required and not article.abstract %}
<li>This journal requires article to have an abstract - this article does not have one <a target="_blank" href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}">[change]<span class="show-for-sr"> Opens in new tab</span></a></li>{% endif %}
<li>This article has been marked as {% if not article.peer_reviewed %}not {% endif %}peer reviewed <a target="_blank" href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}">[change]<span class="show-for-sr"> Opens in new tab</span></a>
{% if not article.get_doi %}<li>No DOI has been assigned <a target="_blank" href="{% url 'edit_identifiers' article.pk %}">[change]<span class="show-for-sr"> Opens in new tab</span></a></li>{% endif %}
{% if not article.keywords.count > 0 %}<li>No keywords have been set <a target="_blank" href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}">[change]<span class="show-for-sr"> Opens in new tab</span></a></li>{% endif %}
{% if not article.issues_list.count > 0 %}<li>This article has not been assigned to an Issue yet{% if article.projected_issue %} It was projected to be in {{ article.projected_issue }}{% endif %} <a href="?m=issue">[change]</a></li>{% endif %}
{% if not article.license %}<li>No license has been set <a target="_blank" href="{% url 'edit_metadata' article.pk %}?return={{ request.path|urlencode }}">[change]<span class="show-for-sr"> Opens in new tab</span></a>.</li>{% endif %}
{% if article.license and not article.license.url %}<li>The set license has no URL <a target="_blank" href="{% url 'submission_licenses_id' article.license.pk %}">[edit license]<span class="show-for-sr"> Opens in new tab</span></a>.</li>{% endif %}
</ul>
{% include "admin/elements/publish/warnings.html" %}
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/templates/admin/submission/edit/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="row expanded">
<form method="POST"{% if journal_settings.general.abstract_required %} novalidate{% endif %}>
<div class="title-area">
<h2>Edit Metadata</h2>
<h2 id="edit-metadata">Edit Metadata</h2>
<a class="button" href="{{ return }}"><i class="fa fa-arrow-left"></i>Back</a>
</div>
<div class="content">
Expand Down Expand Up @@ -122,7 +122,7 @@ <h2>Edit Metadata</h2>
</form>
</div>
<div class="title-area">
<h2>Authors</h2>
<h2 id="edit-metadata-authors">Authors</h2>
{% if frozen_author %}
<a href="{% url 'edit_metadata' article.pk %}?modal=author&return={{ return }}" class="button">Add Author</a>
{% else %}
Expand Down Expand Up @@ -177,7 +177,7 @@ <h2>Authors</h2>
</form>
</div>
<div class="title-area">
<h2>Funding</h2>
<h2 id="edit-metadata-funding">Funding</h2>
</div>
<div class="content submission-content">
<div class="row expanded">
Expand Down Expand Up @@ -221,7 +221,7 @@ <h2>Funding</h2>
</div>

<div class="title-area">
<h2>Current Funders</h2>
<h2 id="edit-metadata-current-funders">Current Funders</h2>
</div>

<div class="row expanded">
Expand Down