Skip to content

Commit b9d1e07

Browse files
committed
fix: only consider non stale approvals at the time of AdvanceApproval
1 parent d455326 commit b9d1e07

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

domain/appeal.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,13 @@ func (a *Appeal) AdvanceApproval(policy *Policy) error {
223223
policyStepCount := len(policy.Steps)
224224
totalStepCount := policyStepCount
225225
if policy.HasCustomSteps() {
226-
totalStepCount = len(a.Approvals)
226+
nonStaleCount := 0
227+
for _, approval := range a.Approvals {
228+
if !approval.IsStale {
229+
nonStaleCount++
230+
}
231+
}
232+
totalStepCount = nonStaleCount
227233
}
228234
for i := 0; i < totalStepCount; i++ {
229235
approval := a.GetApprovalByIndex(i)

0 commit comments

Comments
 (0)