Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/fixing-parameterized-case-type
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Dec 12, 2023
2 parents 1cb6608 + bc2347c commit 2cc0765
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 129 deletions.
4 changes: 2 additions & 2 deletions requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ hypothesis-graphql==0.10.0
# via schemathesis
hypothesis-jsonschema==0.22.1
# via schemathesis
idna==3.4
idna==3.6
# via
# anyio
# email-validator
Expand Down Expand Up @@ -509,7 +509,7 @@ werkzeug==3.0.1
# via schemathesis
wrapt==1.15.0
# via deprecated
yarl==1.9.2
yarl==1.9.4
# via
# aiohttp
# schemathesis
Expand Down
22 changes: 20 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
#
# pip-compile --resolver=backtracking requirements-dev.in
#
aiohttp==3.9.1
# via black
aiosignal==1.3.1
# via aiohttp
asttokens==2.2.1
# via
# devtools
# stack-data
attrs==22.1.0
# via -r requirements-dev.in
black==23.11.0
# via
# -r requirements-dev.in
# aiohttp
black==23.12.0
# via -r requirements-dev.in
cfgv==3.4.0
# via pre-commit
Expand Down Expand Up @@ -38,8 +44,14 @@ faker==20.1.0
# factory-boy
filelock==3.12.2
# via virtualenv
frozenlist==1.4.0
# via
# aiohttp
# aiosignal
identify==2.5.27
# via pre-commit
idna==3.6
# via yarl
iniconfig==2.0.0
# via pytest
ipython==8.18.0
Expand All @@ -48,6 +60,10 @@ jedi==0.19.0
# via ipython
matplotlib-inline==0.1.6
# via ipython
multidict==6.0.4
# via
# aiohttp
# yarl
mypy-extensions==1.0.0
# via black
nodeenv==1.8.0
Expand Down Expand Up @@ -106,6 +122,8 @@ vulture==2.10
# via -r requirements-dev.in
wcwidth==0.2.6
# via prompt-toolkit
yarl==1.9.4
# via aiohttp

# The following packages are considered to be unsafe in a requirements file:
# setuptools
15 changes: 8 additions & 7 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1459,8 +1459,9 @@ def signal_button_click(
if len(raw_text) > 2900:
blocks = [
Section(
text=f"```{raw_text[:2750]}... \n Signal text too long, please vist Dispatch UI for full details.```"
)
text="The alert data exceeds Slack's viewing limit. Please go to the Dispatch Web UI for full details.\n"
),
Section(text=f"```{raw_text[:2750]}...```"),
]
else:
blocks = [Section(text=f"```{raw_text}```")]
Expand Down Expand Up @@ -1619,7 +1620,7 @@ def handle_engagement_submission_event(
# Check if last_mfa_time was within the last hour
last_hour = datetime.now() - timedelta(hours=1)
if (user.last_mfa_time and user.last_mfa_time > last_hour) or mfa_enabled is False:
return send_engagment_response(
return send_engagement_response(
case=case,
client=client,
context_from_user=context_from_user,
Expand All @@ -1638,7 +1639,7 @@ def handle_engagement_submission_event(
type="Are you confirming the behavior as expected in Dispatch?",
)
if response == PushResponseResult.allow:
send_engagment_response(
send_engagement_response(
case=case,
client=client,
context_from_user=context_from_user,
Expand All @@ -1654,7 +1655,7 @@ def handle_engagement_submission_event(
db_session.commit()
return
else:
return send_engagment_response(
return send_engagement_response(
case=case,
client=client,
context_from_user=context_from_user,
Expand All @@ -1668,7 +1669,7 @@ def handle_engagement_submission_event(
)


def send_engagment_response(
def send_engagement_response(
case: Case,
client: WebClient,
context_from_user: str,
Expand Down Expand Up @@ -1710,7 +1711,7 @@ def send_engagment_response(
)

if response == PushResponseResult.allow:
# We only update engagment message (which removes Confirm/Deny button) for success
# We only update engagement message (which removes Confirm/Deny button) for success
# this allows the user to retry the confirmation if the MFA check failed
blocks = create_signal_engagement_message(
case=case,
Expand Down
Loading

0 comments on commit 2cc0765

Please sign in to comment.