Skip to content

Commit

Permalink
💬 Update Slack literal (#22)
Browse files Browse the repository at this point in the history
Update literals
  • Loading branch information
Gary-H9 authored Apr 9, 2024
1 parent 9490387 commit aacf6e4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[flake8]
max-line-length=120
max-line-length=180
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.pylint.'MESSAGES CONTROL']
max-line-length = 120
max-line-length = 180
disable = """
import-error,
missing-function-docstring,
Expand Down
8 changes: 3 additions & 5 deletions src/var/task/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ def handler(event, context): # pylint: disable=unused-argument
# the transfer Lambda
# e.g, "transferred,{supplier}/{file_name},{timestamp}"
message = event["Records"][0]["Sns"]["Message"]
state, object_key, timestamp = message.split( # pylint: disable=unused-variable
","
)
state, object_key, timestamp = message.split(",") # pylint: disable=unused-variable
supplier, file_name = object_key.split("/")[:2]
supplier_config = supplier_configuration(supplier=supplier)

Expand All @@ -124,10 +122,10 @@ def handler(event, context): # pylint: disable=unused-argument
if supplier_config[2]:
send_slack(
slack_channel=supplier_config[2],
message=f"File {file_name} from {supplier} has been transferred to {supplier_config[3]}.",
message=f"A file uploaded by `{supplier}` has been transferred to `{supplier_config[3]}`.\n - `{file_name}`",
)
else:
print(f"No Slack channel configured for {supplier}")
print(f"No Slack channel configured for `{supplier}`")

else:
raise ValueError(f"Invalid mode: {mode}")
Expand Down

0 comments on commit aacf6e4

Please sign in to comment.