diff --git a/journals/admin.py b/journals/admin.py index 18468831ac764f2d2ff54862f5052828fb56044f..8fccd05cca1475fe757dfacc81748b78ab7fa9f2 100644 --- a/journals/admin.py +++ b/journals/admin.py @@ -41,8 +41,6 @@ admin.site.register(Issue, IssueAdmin) class PublicationAdminForm(forms.ModelForm): accepted_submission = forms.ModelChoiceField( queryset=Submission.objects.order_by('-arxiv_identifier_w_vn_nr')) - authors = forms.ModelMultipleChoiceField( - queryset=Contributor.objects.order_by('user__last_name')) authors_claims = forms.ModelMultipleChoiceField( required=False, queryset=Contributor.objects.order_by('user__last_name')) diff --git a/scipost/managers.py b/scipost/managers.py index 72557dcef9879842d124f5960986d443cdc913b0..db457fd9bd20d2ea05fafc34f92021b5f50d5740 100644 --- a/scipost/managers.py +++ b/scipost/managers.py @@ -25,7 +25,7 @@ class ContributorQuerySet(models.QuerySet): def available(self): return self.exclude( unavailability_periods__start__lte=today, - unavailability_periods__end__lte=today) + unavailability_periods__end__gte=today) def awaiting_validation(self): return self.filter(user__is_active=False, status=CONTRIBUTOR_NEWLY_REGISTERED) diff --git a/submissions/forms.py b/submissions/forms.py index 3784031645d090097fa265db42b42111e08258cb..99ec16dd5c4b04c6b7fb0b1cd3e0af3af6917258 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -435,7 +435,7 @@ class EditorialAssignmentForm(forms.ModelForm): self.submission = kwargs.pop('submission') super().__init__(*args, **kwargs) self.fields['to'].queryset = Contributor.objects.available().filter( - fellowships__pool=self.submission).distinct() + fellowships__pool=self.submission).distinct().order_by('user__last_name') def save(self, commit=True): self.instance.submission = self.submission diff --git a/submissions/utils.py b/submissions/utils.py index 2649daa1e9642b86928dda011a82799710a92cf7..0610215599b89987167ca1540b4a2c06b0db2849 100644 --- a/submissions/utils.py +++ b/submissions/utils.py @@ -1375,6 +1375,5 @@ class SubmissionUtils(BaseMailUtil): - `fellow` """ cls._send_mail(cls, 'email_fellow_tasklist', -# [cls._context['fellow'].email_address], - ['jscaux@scipost.org'], # temporary, for testing - 'Current and upcoming tasks') + [cls._context['fellow'].user.email], + 'current assignments, pending tasks') diff --git a/submissions/views.py b/submissions/views.py index 1e1cc60d55ffb75580a290a3a9f9282faee27773..1f6c893527418e40a7d468631be2051d75e0bd54 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -490,6 +490,9 @@ def assignment_request(request, assignment_id): assignment.submission.reporting_deadline = deadline assignment.submission.open_for_commenting = True assignment.submission.latest_activity = timezone.now() + # Save assignment and submission + assignment.save() + assignment.submission.save() SubmissionUtils.load({'assignment': assignment}) SubmissionUtils.deprecate_other_assignments() @@ -505,11 +508,12 @@ def assignment_request(request, assignment_id): assignment.accepted = False assignment.refusal_reason = form.cleaned_data['refusal_reason'] assignment.submission.status = 'unassigned' + + # Save assignment and submission + assignment.save() + assignment.submission.save() msg = 'Thank you for considering' url = reverse('submissions:pool') - # Save assignment and submission - assignment.save() - assignment.submission.save() # Form submitted, redirect user messages.success(request, msg) diff --git a/templates/email/email_fellow_tasklist.html b/templates/email/email_fellow_tasklist.html index 1168cd5d0bf51e6f26e327a843520a002722d27b..946b6d92f136c8f5c8bbe6d5c91b26f81869652f 100644 --- a/templates/email/email_fellow_tasklist.html +++ b/templates/email/email_fellow_tasklist.html @@ -1,8 +1,9 @@ {% load bootstrap %} {% load submissions_extras %} <p>Dear {{ fellow.get_title_display }} {{ fellow.user.last_name }},</p> -<p>Please find below a digest of your current assignments, with (if applicable) pending and upcoming required actions. Many thanks in advance for your timely intervention on any point in need of attention.</p> +<p>Please find below a summary of your current assignments, with (if applicable) pending and upcoming required actions. Many thanks in advance for your timely intervention on any point in need of attention. Your good work as an Editorial Fellow is greatly appreciated!</p> {% if assignments_to_consider %} +<br/> <h3>Assignments for you to consider:</h3> <ul> {% for assignment in assignments_to_consider %} @@ -13,6 +14,7 @@ </ul> {% endif %} {% if assignments_ongoing %} +<br/> <h3>Current assignments (Submissions for which you are Editor-in-charge):</h3> <ul> {% for assignment in assignments_ongoing %} @@ -22,12 +24,12 @@ <em>by {{ assignment.submission.author_list }}</em> </p> {% if assignment.submission.cycle.has_required_actions %} - <h3>Required actions (go to the <a href="https://scipost.org{% url 'submissions:editorial_page' assignment.submission.arxiv_identifier_w_vn_nr %}">Editorial page</a>):</h3> + <h3>Required actions (go to the <a href="https://scipost.org{% url 'submissions:editorial_page' assignment.submission.arxiv_identifier_w_vn_nr %}">Editorial page</a> to carry them out):</h3> <ul> {% for action in assignment.submission.cycle.get_required_actions %} <li>{{action.1}}</li> {% empty %} - <li>No actions required</li> + <li>No action required. Great job!</li> {% endfor %} </ul> {% endif %} @@ -36,6 +38,7 @@ </ul> {% endif %} {% if assignments_upcoming_deadline %} +<br/> <h3>Upcoming refereeing deadlines:</h3> <ul> {% for assignment in assignments_upcoming_deadline %} @@ -45,17 +48,18 @@ <em>by {{ assignment.submission.author_list }}</em> </p> <p>Refereeing deadline: {{ assignment.submission.reporting_deadline|date:"Y-m-d" }}.</p> - <p><em>You can manage this Submission from its </em><a href="https://scipost.org{% url 'submissions:editorial_page' assignment.submission.arxiv_identifier_w_vn_nr %}">Editorial page</a></p> + <p><em>You can manage this Submission from its </em><a href="https://scipost.org{% url 'submissions:editorial_page' assignment.submission.arxiv_identifier_w_vn_nr %}">Editorial page</a>.</p> </li> {% endfor %} </ul> {% endif %} +<br/> <h3>Need help or assistance?</h3> <p> Don't hesitate to <a href="mailto:edadmin@scipost.org">email the editorial administration</a> if you need any assistance. </p> <p> - Many thanks,<br> - The SciPost Team. + Many thanks for your valuable work,<br> + SciPost Editorial Administration </p> {% include 'email/_footer.html' %} diff --git a/templates/email/email_fellow_tasklist.txt b/templates/email/email_fellow_tasklist.txt index 6444d5a2c99caca945f96ffe94e099772517812f..5a1424cd1a55cd578243402fce16a23587b90f5f 100644 --- a/templates/email/email_fellow_tasklist.txt +++ b/templates/email/email_fellow_tasklist.txt @@ -1,6 +1,6 @@ {% load submissions_extras %} Dear {{ fellow.get_title_display }} {{ fellow.user.last_name }},\n\n -Please find below a digest of your current assignments, with (if applicable) pending and upcoming required actions. Many thanks in advance for your timely intervention on any point in need of attention.\n\n +Please find below a digest of your current assignments, with (if applicable) pending and upcoming required actions. Many thanks in advance for your timely intervention on any point in need of attention. Your good work as an Editorial Fellow is greatly appreciated!\n\n {% if assignments_to_consider %} Assignments for you to consider:\n\n {% for assignment in assignments_to_consider %} @@ -18,7 +18,7 @@ Required actions:\n {% for action in assignment.submission.cycle.get_required_actions %} {{action.1}}\n {% empty %} -No actions required\n +No action required. Great job!\n {% endfor %} {% endif %} {% endfor %} @@ -34,5 +34,5 @@ Refereeing deadline: {{ assignment.submission.reporting_deadline|date:"Y-m-d" }} {% endif %} \n You can take action on all of these starting from your personal page at https://scipost.org/personal_page. Don't hesitate to email the editorial administration at edadmin@scipost.org if you need any assistance.\n\n -Many thanks,\n -The SciPost Team. +Many thanks for your valuable work,\n +SciPost Editorial Administration