Skip to content

Commit

Permalink
Minor fix to ApprovalProcess API to improve consistency with document…
Browse files Browse the repository at this point in the history
…ation.
  • Loading branch information
powderflask committed Nov 2, 2024
1 parent 1477253 commit d1a78fd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions signoffs/core/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,17 @@ def get_unapproved_approvals(self):
return [a for a in self.seq.values() if not a.is_approved()]

def get_next_approval(self):
"""Return the "next" approval in sequence ready for signing - sensible only for ordered approvals"""
"""Return the "next" approval in sequence ready for signing - sensible only for ordered approvals
This returns the next approval in sequence, which may or may not be available for signing.
Use `get_next_available_approval` to acquire the next approval that can be signed.
"""
approvals = self.get_unapproved_approvals()
return approvals[0] if approvals else None

def next_approval_is_signed(self):
"""Return True iff the "next" approval in sequence has at least one signatory"""
approval = self.get_next_approval()
"""Return True iff the "next" available approval in sequence has at least one signatory"""
approval = self.get_next_available_approval()
return approval.is_signed() if approval else False

def get_previous_approval(self):
Expand Down

0 comments on commit d1a78fd

Please sign in to comment.