]> git.parisson.com Git - teleforma.git/commitdiff
import: fix is_subscribed
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 17 Mar 2021 12:08:42 +0000 (13:08 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 17 Mar 2021 12:08:42 +0000 (13:08 +0100)
teleforma/views/crfpa.py

index 5618e78dfbe438f41e60bfd06b9fe1cb0cda7c87..5b2b5e0a550a332823c2937adabe8eeecbb15949 100644 (file)
@@ -445,6 +445,7 @@ class UserXLSBook(object):
             student.level = level
             student.period = period
             student.iej = IEJ.objects.get(name=iej)
+            student.is_subscribed = False
 
             student.save()
 
@@ -489,10 +490,13 @@ class UserXLSBook(object):
             payment_type = row[i+1]
             payments = Payment.objects.filter(student=student, month=month[0])
             if not payments and amount:
-                payment = Payment(student=student, value=float(amount), month=month[0], type=payment_type)
+                payment = Payment(student=student, value=float(amount), month=month[0], type=payment_type, online_paid=True)
                 payment.save()
+                student.is_subscribed = True
             i += 2
 
+        student.save()
+
 
     def read(self, path, period):