Skip to content

Commit

Permalink
[Bugfix] - Timezone and expression construction for snooze created vi…
Browse files Browse the repository at this point in the history
…a Slack (#4500)

* [Bugfix] - Timezone and expression construction for snooze created via Slack

* Update src/dispatch/plugins/dispatch_slack/case/interactive.py
  • Loading branch information
wssheldon authored Mar 12, 2024
1 parent 08a1cc1 commit 408c3fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from uuid import UUID
import json
import pytz
Expand Down Expand Up @@ -616,7 +616,7 @@ def _create_snooze_filter(
# Create the new filter from the form data
if form_data.get(DefaultBlockIds.entity_select):
entities = [
{"name": entity.name, "value": entity.value}
{"id": int(entity.value)}
for entity in form_data[DefaultBlockIds.entity_select]
]
else:
Expand Down Expand Up @@ -656,7 +656,7 @@ def _create_snooze_filter(
)

# Calculate the new date by adding the timedelta object to the current date and time
date = datetime.now() + delta
date = datetime.now(tz=timezone.utc) + delta

project = project_service.get(db_session=db_session, project_id=signal.project_id)

Expand Down

0 comments on commit 408c3fe

Please sign in to comment.