Allow Treasurer/Secretary to skip steps

This commit is contained in:
Yingtong Li 2020-01-25 23:18:56 +11:00
parent a9021faedc
commit 4e1e9a611e
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -171,11 +171,13 @@ class BudgetRevision(models.Model):
return False
if not user.groups.filter(name='Treasury').exists():
return False
if self.state == BudgetState.AWAIT_REVIEW.value:
if self.state == BudgetState.AWAIT_REVIEW.value or self.state == BudgetState.DRAFT.value or self.state == BudgetState.RESUBMIT.value:
return True
return False
def can_return(self, user):
if self.state != BudgetState.AWAIT_REVIEW.value:
return False
return self.can_endorse(user)
def can_approve(self, user):
@ -183,11 +185,13 @@ class BudgetRevision(models.Model):
return False
if not user.groups.filter(name='Secretary').exists():
return False
if self.state == BudgetState.ENDORSED.value:
if self.state == BudgetState.ENDORSED.value or self.state == BudgetState.AWAIT_REVIEW.value or self.state == BudgetState.DRAFT.value or self.state == BudgetState.RESUBMIT.value:
return True
return False
def can_cmtereturn(self, user):
if self.state != BudgetState.ENDORSED.value:
return False
return self.can_approve(user)
class ClaimState(DescriptionEnum):