diff --git a/app/modules/incident/incident.py b/app/modules/incident/incident.py index f096eaa1..a3cb76b8 100644 --- a/app/modules/incident/incident.py +++ b/app/modules/incident/incident.py @@ -264,7 +264,11 @@ def submit(ack, view, say, body, client, logger): slug = f"{date} {name}".replace(" ", "-").lower() # Create channel - response = client.conversations_create(name=f"incident-{slug}") + # if we are testing ie PREFIX is "dev" then create the channel with name incident-dev-{slug}. Otherwisse create the channel with name incident-{slug} + if PREFIX == "dev-": + response = client.conversations_create(name=f"incident-dev-{slug}") + else: + response = client.conversations_create(name=f"incident-{slug}") channel_id = response["channel"]["id"] channel_name = response["channel"]["name"] logger.info(f"Created conversation: {channel_name}") diff --git a/app/modules/incident/schedule_retro.py b/app/modules/incident/schedule_retro.py index 30095149..16c120ff 100644 --- a/app/modules/incident/schedule_retro.py +++ b/app/modules/incident/schedule_retro.py @@ -15,8 +15,8 @@ def schedule_event(event_details, days): # Define the time range for the query now = datetime.now(timezone.utc) # time_min is the current time + days and time_max is the current time + 60 days + days - time_min = (now + timedelta(days=days)).isoformat() + "Z" # 'Z' indicates UTC time - time_max = (now + timedelta(days=(60 + days))).isoformat() + "Z" + time_min = (now + timedelta(days=days)).isoformat() + time_max = (now + timedelta(days=(60 + days))).isoformat() # Construct the items array items = []