From bb8f53a4a9dd1c54c2bdbc201788db78c4db2808 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 1 Dec 2021 17:44:10 +0100 Subject: [PATCH] add date interval --- teleforma/management/commands/teleforma-copy-students.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/teleforma/management/commands/teleforma-copy-students.py b/teleforma/management/commands/teleforma-copy-students.py index 2501506b..370af56c 100644 --- a/teleforma/management/commands/teleforma-copy-students.py +++ b/teleforma/management/commands/teleforma-copy-students.py @@ -32,7 +32,8 @@ class Command(BaseCommand): db_from = 'recovery' db_to = 'default' logger = Logger('/var/log/app/student_update_from_recovery.log') - date_limit = datetime.date(year=2021, month=8, day=7) + date_limit_end = datetime.date(year=2021, month=8, day=6) + date_limit_start = datetime.date(year=2021, month=8, day=1) def process_student(self, student, new=True): self.logger.logger.info('----------------------------------------------------------------') @@ -92,7 +93,7 @@ class Command(BaseCommand): if date_paid: if payments_to: payment_to = payments_to[0] - if date_paid != payment_to.date_paid and date_paid >= self.date_limit: + if date_paid != payment_to.date_paid and date_paid >= self.date_limit_start and date_paid <= self.date_limit_end: payment_to.online_paid = payment.online_paid payment_to.date_paid = payment.date_paid payment_to.save() -- 2.39.5