Replace print statement with a logger warning

This commit is contained in:
Oliver 2021-08-23 21:39:54 +10:00
parent 8662e6a109
commit f96051d863

View File

@ -26,6 +26,11 @@ from django.core.exceptions import ValidationError
import InvenTree.helpers import InvenTree.helpers
import InvenTree.fields import InvenTree.fields
import logging
logger = logging.getLogger('inventree')
class BaseInvenTreeSetting(models.Model): class BaseInvenTreeSetting(models.Model):
""" """
@ -1040,7 +1045,7 @@ class PriceBreak(models.Model):
try: try:
converted = convert_money(self.price, currency_code) converted = convert_money(self.price, currency_code)
except MissingRate: except MissingRate:
print(f"WARNING: No currency conversion rate available for {self.price_currency} -> {currency_code}") logger.warning(f"No currency conversion rate available for {self.price_currency} -> {currency_code}")
return self.price.amount return self.price.amount
return converted.amount return converted.amount