diff --git a/submissions/forms.py b/submissions/forms.py index 92f5814d51dd526d4805527b3888bd9cf87234d6..7692bc12e32fc5cf8a18282d485e533bf8e1269d 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -820,6 +820,8 @@ class WithdrawSubmissionForm(forms.Form): self.submission.refresh_from_db() return self.submission + + ###################### # Editorial workflow # ###################### diff --git a/submissions/management/commands/update_search_indices.py b/submissions/management/commands/update_search_indices.py deleted file mode 100644 index 31a56d13f512b845da7f8a3811221c638e1aae22..0000000000000000000000000000000000000000 --- a/submissions/management/commands/update_search_indices.py +++ /dev/null @@ -1,38 +0,0 @@ -__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" -__license__ = "AGPL v3" - - -from django.core.management import BaseCommand - - - -class Command(BaseCommand): - """Update/Reindex all Haystack's search indices.""" - - help = 'Update/Reindex all Haystack's search indices' - - def handle(self, *args, **kwargs): - - count = 0 - - for fellow in fellows: - nr_potfels_to_vote_on = PotentialFellowship.objects.to_vote_on(fellow).count() - recs_to_vote_on = EICRecommendation.objects.user_must_vote_on(fellow.user) - assignments_ongoing = fellow.editorial_assignments.ongoing() - assignments_to_consider = fellow.editorial_assignments.invited() - assignments_upcoming_deadline = assignments_ongoing.refereeing_deadline_within(days=7) - if recs_to_vote_on or assignments_ongoing or assignments_to_consider or assignments_upcoming_deadline: - mail_sender = DirectMailUtil( - 'fellows/email_fellow_tasklist', - # Render immediately, because m2m/querysets cannot be saved for later rendering: - delayed_processing=False, - object=fellow, - fellow=fellow, - nr_potfels_to_vote_on=nr_potfels_to_vote_on, - recs_to_vote_on=recs_to_vote_on, - assignments_ongoing=assignments_ongoing, - assignments_to_consider=assignments_to_consider, - assignments_upcoming_deadline=assignments_upcoming_deadline) - mail_sender.send_mail() - count += 1 - self.stdout.write(self.style.SUCCESS('Emailed {} fellows.'.format(count)))