3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

classes: use get_fields() in make_channel_ban() for more reliable substitutions

This commit is contained in:
James Lu 2018-10-20 12:29:45 -07:00
parent 5a482118b8
commit 6ceaabe092

View File

@ -1411,7 +1411,7 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
'*!*@$host' '*!*@$host'
template = string.Template(ban_style) template = string.Template(ban_style)
banhost = template.safe_substitute(ban_style, **self.users[uid].__dict__) banhost = template.safe_substitute(self.users[uid].get_fields())
assert self.is_hostmask(banhost), "Ban mask %r is not a valid hostmask!" % banhost assert self.is_hostmask(banhost), "Ban mask %r is not a valid hostmask!" % banhost
if ban_type in self.cmodes: if ban_type in self.cmodes: