From 514482bb5c53160c857b79fa3caac2695df015dc Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Wed, 17 Apr 2019 07:18:48 +0200 Subject: [PATCH] Remove broken management command --- submissions/forms.py | 2 + .../commands/update_search_indices.py | 38 ------------------- 2 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 submissions/management/commands/update_search_indices.py diff --git a/submissions/forms.py b/submissions/forms.py index 92f5814d5..7692bc12e 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 31a56d13f..000000000 --- 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))) -- GitLab