summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-18 16:07:09 -0500
committerBen Sima <ben@bsima.me>2025-11-18 16:07:09 -0500
commit2bd0fcfb9a8dd7d8e1a7564bd8c747e7290ef626 (patch)
treefc86ec099dc1e42fb3beccdbc6772ab0284e91e4 /Biz/PodcastItLater
parent2e95d6eba0d6292ec263ebd8723b6b4fb2c36268 (diff)
Fix type mismatch in track_episode_metric logging
Changed logger format from %d to %s for episode_id to handle cases where the ID might be passed as a string from route parameters. Error was: Message: 'Tracked %s event for episode %d (user: %s)' Arguments: ('added', '2', 1) Using %s is more flexible and works with both int and str types.
Diffstat (limited to 'Biz/PodcastItLater')
-rw-r--r--Biz/PodcastItLater/Core.py4
-rw-r--r--Biz/PodcastItLater/UI.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/Biz/PodcastItLater/Core.py b/Biz/PodcastItLater/Core.py
index 5e476c1..f1f89e9 100644
--- a/Biz/PodcastItLater/Core.py
+++ b/Biz/PodcastItLater/Core.py
@@ -41,7 +41,7 @@ TITLE_TRUNCATE_LENGTH = 50
ERROR_TRUNCATE_LENGTH = 50
# Admin whitelist
-ADMIN_EMAILS = ["ben@bensima.com", "demo@example.com", "admin@example.com"]
+ADMIN_EMAILS = ["ben@bensima.com", "admin@example.com"]
def is_admin(user: dict[str, typing.Any] | None) -> bool:
@@ -1049,7 +1049,7 @@ class Database: # noqa: PLR0904
)
conn.commit()
logger.info(
- "Tracked %s event for episode %d (user: %s)",
+ "Tracked %s event for episode %s (user: %s)",
event_type,
episode_id,
user_id or "anonymous",
diff --git a/Biz/PodcastItLater/UI.py b/Biz/PodcastItLater/UI.py
index a457a02..da0193c 100644
--- a/Biz/PodcastItLater/UI.py
+++ b/Biz/PodcastItLater/UI.py
@@ -131,7 +131,7 @@ def is_admin(user: dict[str, typing.Any] | None) -> bool:
"""Check if user is an admin based on email whitelist."""
if not user:
return False
- admin_emails = ["ben@bensima.com", "demo@example.com", "admin@example.com"]
+ admin_emails = ["ben@bensima.com", "admin@example.com"]
return user.get("email", "").lower() in [
email.lower() for email in admin_emails
]