SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit d2667ea1 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

limit required actions for past submissions

parent feeb646d
No related branches found
No related tags found
No related merge requests found
...@@ -582,7 +582,7 @@ class Submission(models.Model): ...@@ -582,7 +582,7 @@ class Submission(models.Model):
@property @property
def is_latest(self): def is_latest(self):
return self.status != self.RESUBMITTED return self == self.get_latest_version()
@property @property
def authors_as_list(self): def authors_as_list(self):
......
...@@ -12,6 +12,11 @@ from common.utils import get_current_domain ...@@ -12,6 +12,11 @@ from common.utils import get_current_domain
from . import constants from . import constants
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from submissions.models.submission import Submission
@html_safe @html_safe
class RequiredActionsDict(dict): class RequiredActionsDict(dict):
...@@ -243,7 +248,7 @@ class BaseCycle: ...@@ -243,7 +248,7 @@ class BaseCycle:
days_for_refereeing = 28 days_for_refereeing = 28
can_invite_referees = True can_invite_referees = True
def __init__(self, submission): def __init__(self, submission: "Submission"):
self._submission = submission self._submission = submission
self._required_actions = None self._required_actions = None
...@@ -274,6 +279,19 @@ class BaseCycle: ...@@ -274,6 +279,19 @@ class BaseCycle:
"""Gather the required actions list and populate self._required_actions.""" """Gather the required actions list and populate self._required_actions."""
self._required_actions = RequiredActionsDict() self._required_actions = RequiredActionsDict()
# Comments requiring vetting (including replies and recursive comments)
comments_to_vet = self._submission.comments_set_complete().awaiting_vetting()
for comment in comments_to_vet:
self.add_action(VettingAction(comment))
reports_to_vet = self._submission.reports.awaiting_vetting()
for report in reports_to_vet:
self.add_action(VettingAction(report))
# If this cycle is not the latest one in the thread, return early, skipping other actions
if not self._submission.is_latest:
return
if not self._submission.refereeing_cycle: if not self._submission.refereeing_cycle:
# Submission is a resubmission: EIC has to determine which cycle to proceed with. # Submission is a resubmission: EIC has to determine which cycle to proceed with.
self.add_action(CycleChoiceAction()) self.add_action(CycleChoiceAction())
...@@ -288,15 +306,6 @@ class BaseCycle: ...@@ -288,15 +306,6 @@ class BaseCycle:
) )
self.add_action(action) self.add_action(action)
# Comments requiring vetting (including replies and recursive comments)
comments_to_vet = self._submission.comments_set_complete().awaiting_vetting()
for comment in comments_to_vet:
self.add_action(VettingAction(comment))
reports_to_vet = self._submission.reports.awaiting_vetting()
for report in reports_to_vet:
self.add_action(VettingAction(report))
if self.can_invite_referees and self._submission.in_stage_in_refereeing: if self.can_invite_referees and self._submission.in_stage_in_refereeing:
# Referees required in this cycle. # Referees required in this cycle.
referee_invitations_count = ( referee_invitations_count = (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment