Skip to content

Commit

Permalink
fix: update applet integrations check in ws_api
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaconC committed Jan 22, 2025
1 parent 087ab1e commit 5dec502
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/apps/alerts/ws_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from apps.alerts.domain import AlertHandlerResult, AlertMessage
from apps.applets.crud import AppletHistoriesCRUD, AppletsCRUD
from apps.authentication.deps import get_current_user_for_ws
from apps.integrations.crud.integrations import IntegrationsCRUD
from apps.shared.exception import ValidationError
from apps.subjects.services import SubjectsService
from apps.users import User
Expand Down Expand Up @@ -52,19 +53,20 @@ async def _handle_websocket(websocket, user_id, session):
Role.RESPONDENT,
)

applet_history, applet, workspace, subject = await asyncio.gather(
applet_history, applet, workspace, subject, integrations = await asyncio.gather(
AppletHistoriesCRUD(session).retrieve_by_applet_version(
f"{alert_message.applet_id}_{alert_message.version}"
),
AppletsCRUD(session).get_by_id(alert_message.applet_id),
UserWorkspaceCRUD(session).get_by_user_id(respondent_access.owner_id),
SubjectsService(session, respondent_access.owner_id).get(alert_message.subject_id),
IntegrationsCRUD(session).retrieve_list_by_applet(alert_message.applet_id),
)
except Exception as e:
traceback.print_tb(e.__traceback__)
continue
try:
if applet.integrations and "loris" in applet.integrations:
if integrations and "loris" in integrations:
_secret_id = "Loris Integration"
else:
_secret_id = subject.secret_user_id if subject else "Anonymous"
Expand Down

0 comments on commit 5dec502

Please sign in to comment.