fix invoice price error
This commit is contained in:
parent
651d0f83fb
commit
efe31346f1
1 changed files with 7 additions and 5 deletions
|
@ -26,6 +26,9 @@ class InvoiceHandler(metaclass=abc.ABCMeta):
|
||||||
price = self.get_price(payload)
|
price = self.get_price(payload)
|
||||||
if price is None:
|
if price is None:
|
||||||
raise PriceNotFound()
|
raise PriceNotFound()
|
||||||
|
|
||||||
|
hourly_price = price.hourly_price
|
||||||
|
monthly_price = price.monthly_price
|
||||||
except PriceNotFound as e:
|
except PriceNotFound as e:
|
||||||
send_notification(
|
send_notification(
|
||||||
project=None,
|
project=None,
|
||||||
|
@ -35,14 +38,13 @@ class InvoiceHandler(metaclass=abc.ABCMeta):
|
||||||
)
|
)
|
||||||
|
|
||||||
if fallback_price:
|
if fallback_price:
|
||||||
price = PriceMixin()
|
hourly_price = Money(amount=0, currency=settings.DEFAULT_CURRENCY)
|
||||||
price.hourly_price = Money(amount=0, currency=settings.DEFAULT_CURRENCY)
|
monthly_price = Money(amount=0, currency=settings.DEFAULT_CURRENCY)
|
||||||
price.monthly_price = Money(amount=0, currency=settings.DEFAULT_CURRENCY)
|
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
payload['hourly_price'] = price.hourly_price
|
payload['hourly_price'] = hourly_price
|
||||||
payload['monthly_price'] = price.monthly_price
|
payload['monthly_price'] = monthly_price
|
||||||
|
|
||||||
self.INVOICE_CLASS.objects.create(**payload)
|
self.INVOICE_CLASS.objects.create(**payload)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue