Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading