Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ def _get_env_variable(name: str, default: str | None = None) -> str | None:
WIKI_CATEGORY: str = _get_env_variable("WIKI_CATEGORY", "JobAdvice")

with open(os.path.join(BASE_DIR, "static", "slack", "dm_request_template.json")) as f:
SLACK_DM_TEMPLATE = dict(json.load(f))
SLACK_DM_TEMPLATE = json.load(f)
5 changes: 0 additions & 5 deletions src/core/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ async def request_upload_via_dm(user_id: str, announcement_text: str) -> None:

message: dict = copy.deepcopy(SLACK_DM_TEMPLATE)

print(message)

message[0]["text"]["text"] += announcement_text
message[1]["elements"][0]["value"] = json.dumps(
{
Expand All @@ -103,9 +101,6 @@ async def request_upload_via_dm(user_id: str, announcement_text: str) -> None:
logger.error(f"Full Slack Error: {e.response}")
except Exception as e:
logger.error(f"Error messaging user {user_id}: {e}")
logger.error(f"Exception type: {type(e)}")
logger.error(f"Exception repr: {repr(e)}")
logger.exception("Full stack trace:")


def convert_user_response_to_bool(message_data: dict) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def test_with_slack_token_parses_values(monkeypatch) -> None:
assert cfg.CALENDAR_OUTLOOK_DAYS == 5
assert cfg.CALENDAR_EVENT_MAXIMUM == 20
assert cfg.CALENDAR_TIMEZONE == "UTC"
assert isinstance(cfg.SLACK_DM_TEMPLATE, dict)
assert isinstance(cfg.SLACK_DM_TEMPLATE, list)
Loading