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

Accounting for condition where app_unfurl_url does not exist #360

Merged
merged 2 commits into from
Jan 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
5 changes: 3 additions & 2 deletions app/commands/incident.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def handle_incident_action_buttons(client, ack, body, logger):
f"<@{user}> a pris connaissance et ignoré l'incident."
)
# if the last attachment is a preview from a link, switch the places of the last 2 attachments so that the incident buttons can be appended properly
if len(attachments) > 1 and attachments[-1]["app_unfurl_url"]:
attachments[-2], attachments[-1] = attachments[-1], attachments[-2]
if len(attachments) > 1:
if "app_unfurl_url" in attachments[-1]:
attachments[-2], attachments[-1] = attachments[-1], attachments[-2]
attachments[-1] = {
"color": "3AA3E3",
"fallback": f"{msg}",
Expand Down
Loading