diff --git a/src/config.py b/src/config.py index aacf3a9..3e3eb81 100644 --- a/src/config.py +++ b/src/config.py @@ -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) diff --git a/src/core/slack.py b/src/core/slack.py index d508374..36b9cdd 100644 --- a/src/core/slack.py +++ b/src/core/slack.py @@ -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( { @@ -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: diff --git a/tests/src/test_config.py b/tests/src/test_config.py index 49c16e0..767b36f 100644 --- a/tests/src/test_config.py +++ b/tests/src/test_config.py @@ -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)