From: Guillaume Pellerin Date: Wed, 1 Dec 2021 16:44:10 +0000 (+0100) Subject: add date interval X-Git-Tag: 2.5.1~23^2~2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bb8f53a4a9dd1c54c2bdbc201788db78c4db2808;p=teleforma.git add date interval --- 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()