Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the type of watch or blacklist (e.g., keyword, website, number) to the title of the PR #12206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
Loading