Skip to content

Commit

Permalink
fix reference to stage ID
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRyanSmith committed Jan 15, 2025
1 parent 9c3d475 commit aa9b01f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions internals/maintenance_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit aa9b01f

Please sign in to comment.