Skip to content

Commit a22b999

Browse files
committed
Fix provision result type check
At times, the result might be just an integer, such as when using min.
1 parent c27e408 commit a22b999

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kirppu/provision.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def run_function(cls, provision_function, sold_and_compensated) -> Optional[Deci
6565

6666
_r = run(provision_function, sold_and_compensated=sold_and_compensated)
6767

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

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

0 commit comments

Comments
 (0)