Skip to content

Commit

Permalink
Fixing up a bug plus adding dev to channel (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylviamclaughlin authored Apr 17, 2024
1 parent 0731c4b commit 3ca7cb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/modules/incident/incident.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
4 changes: 2 additions & 2 deletions app/modules/incident/schedule_retro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 3ca7cb7

Please sign in to comment.