Fix withdraw permission logic
This commit is contained in:
parent
74d4c7b333
commit
a1aa2423ad
@ -160,8 +160,11 @@ class BudgetRevision(models.Model):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def can_withdraw(self, user):
|
def can_withdraw(self, user):
|
||||||
if not self.can_edit(user):
|
if not self.can_view(user):
|
||||||
return False
|
return False
|
||||||
|
if user != self.author and user not in self.contributors.all() and not user.groups.filter(name='Treasury').exists():
|
||||||
|
return False
|
||||||
|
|
||||||
if self.state == BudgetState.AWAIT_REVIEW.value or self.state == BudgetState.ENDORSED.value:
|
if self.state == BudgetState.AWAIT_REVIEW.value or self.state == BudgetState.ENDORSED.value:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user