From aa9b01f62428fab37a81e9ab6219aedb3db693d9 Mon Sep 17 00:00:00 2001 From: DanielRyanSmith Date: Wed, 15 Jan 2025 22:28:28 +0000 Subject: [PATCH] fix reference to stage ID --- internals/maintenance_scripts.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/internals/maintenance_scripts.py b/internals/maintenance_scripts.py index 21a00e2fcc4c..ed22dac6ef1a 100644 --- a/internals/maintenance_scripts.py +++ b/internals/maintenance_scripts.py @@ -806,13 +806,14 @@ def calc_needs_work_started_on( class SendManualOTCreatedEmail(FlaskHandler): """Manually send an email to origin trial contacts that an origin trial has been created but not yet activated.""" - def get_template_data(self): + + def get_template_data(self, **kwargs): self.require_cron_header() - stage_id = self.get_param('stage_id') + stage_id = kwargs.get('stage_id') stage: Stage|None = Stage.get_by_id(stage_id) if not stage: - self.abort(400, f'Stage {stage_id} not found') + return f'Stage {stage_id} not found' cloud_tasks_helpers.enqueue_task( '/tasks/email-ot-creation-processed', @@ -823,13 +824,14 @@ def get_template_data(self): class SendManualOTActivatedEmail(FlaskHandler): """Manually send an email to origin trial contacts that an origin trial has been created and also activated.""" - def get_template_data(self): + + def get_template_data(self, **kwargs): self.require_cron_header() - stage_id = self.get_param('stage_id') + stage_id = kwargs.get('stage_id') stage: Stage|None = Stage.get_by_id(stage_id) if not stage: - self.abort(400, f'Stage {stage_id} not found') + return f'Stage {stage_id} not found' cloud_tasks_helpers.enqueue_task( '/tasks/email-ot-activated',