]> git.parisson.com Git - teleforma.git/commitdiff
Add Training.platform_only
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 11 Oct 2019 15:51:34 +0000 (17:51 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 11 Oct 2019 15:51:34 +0000 (17:51 +0200)
teleforma/models/crfpa.py

index e57cd409795048b3231848994d31ab975e86f1ee..119731b865c328ceb6e699680b5b7a927dc85eef 100755 (executable)
@@ -109,6 +109,7 @@ class Training(Model):
                                         blank=True, null=True)
     cost = models.FloatField(_('cost'), blank=True, null=True)
     available = models.BooleanField(_('available'))
+    platform_only = models.BooleanField(_('e-learning platform only'))
 
     def __unicode__(self):
         if self.name and self.period:
@@ -176,7 +177,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
@@ -200,7 +201,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
@@ -221,7 +222,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 + self.total_paybacks, 2)
@@ -243,7 +244,7 @@ def update_balance_signal(sender, instance, *args, **kwargs):
         instance.update_balance()
     elif sender in (Discount, OptionalFee, Payment, Payback):
         instance.student.update_balance()
-        
+
 signals.post_save.connect(update_balance_signal)
 signals.post_delete.connect(update_balance_signal)