diff --git a/refunding/models.py b/refunding/models.py index 9470840..0984ec3 100644 --- a/refunding/models.py +++ b/refunding/models.py @@ -2,6 +2,9 @@ from django.db import models from django.conf import settings from django.db.models import Sum +import logging +logger = logging.getLogger(__name__) + AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') @@ -24,7 +27,7 @@ class Refund(models.Model): return 0 def __str__(self) -> str: - return "{0} on {1} for {2}".format(self.title, self.date, self.eur_value()) + return "{0} on {1} for {2:.2f}".format(self.title, self.date, self.eur_value()) class Payment(models.Model): @@ -45,7 +48,9 @@ class Payment(models.Model): ) def __str__(self) -> str: - return '{0} on {1} for {2}'.format(self.title, self.date, self.value / 100) + s = '{0} on {1} for {2:.2f}'.format(self.title, self.date, self.value / 100) + logger.error(s) + return s def eur_value(self) -> float: return self.value / 100 diff --git a/refunding/templates/refunding/elements_list.html b/refunding/templates/refunding/elements_list.html index 3e52530..6c9f6f1 100644 --- a/refunding/templates/refunding/elements_list.html +++ b/refunding/templates/refunding/elements_list.html @@ -13,7 +13,7 @@ {% else %}