Browse Source

Shortens the formatting of the date in the '__unicode__' method

rezemika 6 years ago
parent
commit
78b24b9b84
1 changed files with 4 additions and 5 deletions
  1. 4 5
      coin/billing/models.py

+ 4 - 5
coin/billing/models.py

@@ -439,13 +439,12 @@ class Payment(models.Model):
         self.save()
 
     def __unicode__(self):
-        date = self.date.strftime("%d/%m/%Y")
         if self.member is not None:
-            return 'Paiment de {}€ le {} par {}'.format(
-                self.amount, date, self.member)
+            return 'Paiment de {:0.2f}€ le {:%d/%m/%Y} par {}'.format(
+                self.amount, self.date, self.member)
         else:
-            return 'Paiment de {}€ le {}'.format(
-                self.amount, date)
+            return 'Paiment de {:0.2f}€ le {:%d/%m/%Y}'.format(
+                self.amount, self.date)
 
     class Meta:
         verbose_name = 'paiement'