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',