From e28a814edf0da208c97411dc4f93e20dea717861 Mon Sep 17 00:00:00 2001 From: Yingtong Li Date: Mon, 8 Jun 2020 01:11:10 +1000 Subject: [PATCH] Ditto for reimbursement claims --- sstreasury/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sstreasury/models.py b/sstreasury/models.py index b6b5dbe..87c82e5 100644 --- a/sstreasury/models.py +++ b/sstreasury/models.py @@ -285,8 +285,11 @@ class ReimbursementClaim(models.Model): return False def can_withdraw(self, user): - if not self.can_edit(user): + if not self.can_view(user): return False + if user != self.author and not user.groups.filter(name='Treasury').exists(): + return False + if self.state == ClaimState.AWAIT_REVIEW.value or self.state == ClaimState.APPROVED.value: return True return False