Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/handle-no-case-conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Oct 22, 2024
2 parents d775be6 + 9f7ecd7 commit efabfce
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.13.0-slim-bullseye as sdist
FROM python:3.11.4-slim-bullseye as sdist

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.title="Dispatch PyPI Wheel"
Expand Down Expand Up @@ -56,7 +56,7 @@ RUN YARN_CACHE_FOLDER="$(mktemp -d)" \
&& mv /usr/src/dispatch/dist /dist

# This is the image to be run
FROM python:3.13.0-slim-bullseye
FROM python:3.11.4-slim-bullseye

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.title="Dispatch"
Expand Down
1 change: 1 addition & 0 deletions src/dispatch/plugins/dispatch_core/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def update(
document_weblink: str,
storage_weblink: str,
conference_weblink: str,
dispatch_weblink: str,
cost: float,
incident_type_plugin_metadata: dict = None,
):
Expand Down
11 changes: 11 additions & 0 deletions src/dispatch/plugins/dispatch_slack/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,18 @@ def get_request_handler(request: Request, body: bytes, organization: str) -> Sla
)
async def slack_events(request: Request, organization: str, body: bytes = Depends(get_body)):
"""Handle all incoming Slack events."""

handler = get_request_handler(request=request, body=body, organization=organization)
try:
body_json = json.loads(body)
# if we're getting the url verification request,
# handle it synchronously so that slack api verification works
if body_json.get("type") == "url_verification":
return handler.handle(req=request, body=body)
except json.JSONDecodeError:
pass

# otherwise, handle it asynchronously
task = BackgroundTask(handler.handle, req=request, body=body)
return JSONResponse(
background=task,
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/signal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def update_filter(
signal_filter_in: SignalFilterUpdate,
):
"""Updates an existing signal filter."""
signal_filter = get_signal_filter(db_session=db_session, signal_id=signal_filter_id)
signal_filter = get_signal_filter(db_session=db_session, signal_filter_id=signal_filter_id)
if not signal_filter:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
Expand Down
6 changes: 3 additions & 3 deletions tests/incident_cost/test_incident_cost_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_calculate_incident_response_cost_with_cost_model(
):
"""Tests that the incident cost is calculated correctly when a cost model is enabled."""
from datetime import timedelta
from decimal import Decimal, ROUND_UP
from decimal import Decimal, ROUND_HALF_UP
from dispatch.incident_cost.service import update_incident_response_cost, get_hourly_rate
from dispatch.incident_cost_type import service as incident_cost_type_service
from dispatch.participant_activity.service import (
Expand Down Expand Up @@ -154,8 +154,8 @@ def test_calculate_incident_response_cost_with_cost_model(
) * hourly_rate + orig_total_incident_cost

assert cost
assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_UP)
assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_UP)
assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_HALF_UP)
assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_HALF_UP)


def test_calculate_incident_response_cost_with_cost_model__no_enabled_plugins(
Expand Down

0 comments on commit efabfce

Please sign in to comment.