From 26a77b1f6f68795dd822af1f2a7cc48649ca1d93 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 22 Nov 2023 18:05:44 +0100 Subject: [PATCH] add args --- .../commands/teleforma-reset-all-passwords-with-mail.py | 3 +++ teleforma/management/commands/teleforma-send-payment-emails.py | 1 + .../management/commands/teleforma-send-subscription-email.py | 3 +++ teleforma/management/commands/teleforma-students-activate.py | 3 +++ 4 files changed, 10 insertions(+) diff --git a/teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py b/teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py index 6366fbb4..16449e19 100644 --- a/teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py +++ b/teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py @@ -39,6 +39,9 @@ class Command(BaseCommand): message = render_to_string(self.message_template, ctx_dict) send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email], fail_silently=False) + def add_arguments(self, parser): + parser.add_argument('args', nargs='*') + def handle(self, *args, **options): log_file = args[-1] period_name = args[-2] diff --git a/teleforma/management/commands/teleforma-send-payment-emails.py b/teleforma/management/commands/teleforma-send-payment-emails.py index bdb024b9..95db695a 100644 --- a/teleforma/management/commands/teleforma-send-payment-emails.py +++ b/teleforma/management/commands/teleforma-send-payment-emails.py @@ -39,6 +39,7 @@ class Command(BaseCommand): message = render_to_string(message_template, ctx_dict) send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [student.user.email], fail_silently=False) + def handle(self, *args, **options): log_file = options['log_file'] logger = Logger(log_file) diff --git a/teleforma/management/commands/teleforma-send-subscription-email.py b/teleforma/management/commands/teleforma-send-subscription-email.py index fcc0178f..2fc583f1 100644 --- a/teleforma/management/commands/teleforma-send-subscription-email.py +++ b/teleforma/management/commands/teleforma-send-subscription-email.py @@ -46,6 +46,9 @@ class Command(BaseCommand): message = render_to_string(message_template, ctx_dict) send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [student.user.email], fail_silently=False) + def add_arguments(self, parser): + parser.add_argument('args', nargs='*') + def handle(self, *args, **options): log_file = args[-1] period_name = args[-2] diff --git a/teleforma/management/commands/teleforma-students-activate.py b/teleforma/management/commands/teleforma-students-activate.py index 16be2daa..03e1bf8e 100644 --- a/teleforma/management/commands/teleforma-students-activate.py +++ b/teleforma/management/commands/teleforma-students-activate.py @@ -28,6 +28,9 @@ class Logger: class Command(BaseCommand): help = "Activate all user account for subscribed students" + def add_arguments(self, parser): + parser.add_argument('args', nargs='*') + def handle(self, *args, **options): period_name = args[-2] log_file = args[-1] -- 2.39.5