Skip to content

Commit 2eea73c

Browse files
committed
Minor fixes
1 parent 171233a commit 2eea73c

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/classes/notification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def render_notification(self, recent_submissions=None):
5555
target_is_author = self.subscription.author is not None and self.subscription.author == self.subscription.subscriber
5656
if not target_is_author and self.subscription.subscriber.short_notifs:
5757
bldr.append("New thread from u/")
58-
bldr.append(self.submission.author.name)
58+
bldr.append(utils.escape_username(self.submission.author.name))
5959
if self.submission.tag is not None:
6060
bldr.append(" with the tag <")
6161
bldr.append(self.submission.tag)

src/subreddits.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ def scan_subreddit_group(database, reddit, subreddits, submission_ids_scanned):
275275
error_string = "redirect"
276276
if error_string is not None:
277277
if len(subreddit_names) == 1:
278-
log.warning(f"Got {error_string} for subreddit: r/{group_string} : {get_blacklist_mute_message(group_string)}")
278+
count_subs = database.get_count_subscriptions_for_subreddit(group_string)
279+
log.warning(f"Got {error_string} for subreddit {count_subs}: r/{group_string} : {get_blacklist_mute_message(group_string)}")
279280
return True
280281
else:
281282
log.warning(f"Got {error_string} for subreddit group, splitting: {group_string}")

src/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,9 @@ def reddit_link(subreddit, submission, comment=None, title=None, discord_escape=
212212
if title is not None:
213213
result = f"[{title}]({result})"
214214
return result
215+
216+
217+
def escape_username(username):
218+
if username is None:
219+
return None
220+
return username.replace("_", "\_")

0 commit comments

Comments
 (0)