Skip to content

Commit

Permalink
Add the type of watch or blacklist (e.g., keyword, website, number) t…
Browse files Browse the repository at this point in the history
…o the title of the PR

Resolves Charcoal-SE#12205
  • Loading branch information
gparyani authored Jul 22, 2024
1 parent c1275a6 commit 6b63b1a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gitmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,13 @@ def add_to_blacklist(cls, blacklist='', item_to_blacklist='', username='', chat_

now = str(int(time.time()))

type_friendly_name = blacklist

if blacklist_type in {Blacklist.WATCHED_KEYWORDS, Blacklist.WATCHED_NUMBERS}:
op = 'watch'
item = item_to_blacklist
item_to_blacklist = "\t".join([now, username, item])
type_friendly_name = blacklist.split('_')[1]
else:
op = 'blacklist'
item = item_to_blacklist
Expand Down Expand Up @@ -195,7 +198,7 @@ def add_to_blacklist(cls, blacklist='', item_to_blacklist='', username='', chat_
and (GlobalVars.github_access_token is None)):
return (False, "Tell someone to set a GH token.")

payload = {"title": "{0}: {1} {2}".format(username, op.title(), item),
payload = {"title": "{0}: {1} {2} {3}".format(username, op.title(), type_friendly_name, item),
"body": "[{0}]({1}) requests the {2} of the {3} `{4}`. See the MS search [here]"
"(https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93{5}{6}) and the "
"Stack Exchange search [in text](https://stackexchange.com/search?q=%22{7}%22)"
Expand Down

0 comments on commit 6b63b1a

Please sign in to comment.