Skip to content

Commit

Permalink
Fix provision result type check
Browse files Browse the repository at this point in the history
At times, the result might be just an integer, such as when using min.
  • Loading branch information
jlaunonen committed Sep 1, 2024
1 parent c27e408 commit a22b999
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kirppu/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def run_function(cls, provision_function, sold_and_compensated) -> Optional[Deci

_r = run(provision_function, sold_and_compensated=sold_and_compensated)

assert _r is None or isinstance(_r, Decimal), "Value returned from function must be null or a number"
assert _r is None or isinstance(_r, (Decimal, int)), "Value returned from function must be null or a number"
return _r

def _run_function(self, items: Optional[QuerySet] = None) -> Optional[Decimal]:
Expand Down

0 comments on commit a22b999

Please sign in to comment.