Skip to content

Commit bbdb88e

Browse files
committed
fix: correct voucher usage type assignment in Voucher model
1 parent 2afabeb commit bbdb88e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/budy/models/voucher.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,13 @@ def use_s(self, amount, currency=None, justification=None, save_use=True):
336336
self.usage_count += 1
337337
self.save()
338338
if save_use:
339+
usage_type = "value" if self.is_value else "percentage"
339340
voucher_use_ = voucher_use.VoucherUse(
340-
voucher=self,
341+
usage_type=usage_type,
341342
amount=amount,
342343
currency=currency,
343344
justification=justification,
345+
voucher=self,
344346
)
345347
voucher_use_.save()
346348
return voucher_use_

0 commit comments

Comments
 (0)