]> git.parisson.com Git - teleforma.git/commitdiff
Fix ClassGroup str
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 21 Jan 2019 17:51:22 +0000 (18:51 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 21 Jan 2019 17:51:22 +0000 (18:51 +0100)
teleforma/models/crfpa.py

index 36a93a6b4e05c5b6dfdbae5e7a735a54ae6a44de..84cde210a65b1b0e9de832eb44b16d7c24872a84 100755 (executable)
@@ -73,6 +73,9 @@ class ClassGroup(models.Model):
                  }
         return data
 
+    def __unicode__(self):
+        return self.name
+
 
 class Training(Model):
 
@@ -175,7 +178,7 @@ class Student(Model):
 
     fascicule = models.BooleanField(_('envoi des fascicules'), blank=True,
                                     default=False)
-    
+
     def __unicode__(self):
         try:
             return self.user.last_name + ' ' + self.user.first_name
@@ -199,7 +202,7 @@ class Student(Model):
         for optional_fee in self.optional_fees.values('value'):
             amount += optional_fee['value']
         return amount
-    
+
     @property
     def total_payments(self):
         amount = 0
@@ -220,7 +223,7 @@ class Student(Model):
         for payback in self.paybacks.values('value'):
             amount -= payback['value']
         return amount
-        
+
     def update_balance(self):
         old = self.balance
         new = round(self.total_payments - self.total_fees, 2)
@@ -242,7 +245,7 @@ def update_balance_signal(sender, instance, *args, **kwargs):
         instance.update_balance()
     elif sender in (Discount, OptionalFee, Payment):
         instance.student.update_balance()
-        
+
 signals.post_save.connect(update_balance_signal)
 signals.post_delete.connect(update_balance_signal)