Skip to content

Commit 6b63b1a

Browse files
authored
Add the type of watch or blacklist (e.g., keyword, website, number) to the title of the PR
Resolves Charcoal-SE#12205
1 parent c1275a6 commit 6b63b1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitmanager.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,13 @@ def add_to_blacklist(cls, blacklist='', item_to_blacklist='', username='', chat_
142142

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

145+
type_friendly_name = blacklist
146+
145147
if blacklist_type in {Blacklist.WATCHED_KEYWORDS, Blacklist.WATCHED_NUMBERS}:
146148
op = 'watch'
147149
item = item_to_blacklist
148150
item_to_blacklist = "\t".join([now, username, item])
151+
type_friendly_name = blacklist.split('_')[1]
149152
else:
150153
op = 'blacklist'
151154
item = item_to_blacklist
@@ -195,7 +198,7 @@ def add_to_blacklist(cls, blacklist='', item_to_blacklist='', username='', chat_
195198
and (GlobalVars.github_access_token is None)):
196199
return (False, "Tell someone to set a GH token.")
197200

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

0 commit comments

Comments
 (0)