From: Guillaume Pellerin Date: Wed, 22 Nov 2023 17:05:44 +0000 (+0100) Subject: add args X-Git-Tag: 2.8.1-ae~12 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=26a77b1f6f68795dd822af1f2a7cc48649ca1d93;p=teleforma.git add args --- 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]