From e0644d0e4c6995fc7d270dd44e0d445b95cac9f5 Mon Sep 17 00:00:00 2001 From: Ostap Zherebetskyi Date: Mon, 6 Jan 2025 12:12:53 +0200 Subject: [PATCH] allow resubmission for POST_MODERATION workflow --- osf/utils/machines.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osf/utils/machines.py b/osf/utils/machines.py index 8e4b8f07338..35540c4562d 100644 --- a/osf/utils/machines.py +++ b/osf/utils/machines.py @@ -123,7 +123,14 @@ def save_changes(self, ev): self.machineable.save() def resubmission_allowed(self, ev): - return self.machineable.provider.reviews_workflow == Workflows.PRE_MODERATION.value + workflow = self.machineable.provider.reviews_workflow + result = any( + [ + workflow == Workflows.PRE_MODERATION.value, + workflow == Workflows.POST_MODERATION.value and self.machineable.machine_state == 'pending' + ] + ) + return result def perform_withdraw(self, ev): self.machineable.date_withdrawn = self.action.created if self.action is not None else timezone.now()