AttackProtector: Fix config validation.
parent
04a42e5837
commit
4dcf412f39
|
@ -62,10 +62,11 @@ XpY = internationalizeDocstring(XpY)
|
|||
|
||||
class Punishment(registry.String):
|
||||
"""Value must be a valid punishment ('ban', 'kick', 'kban', 'mode+X',
|
||||
'mode-X', 'command XXX', ...)"""
|
||||
'mode-X', 'umode-X', 'command XXX', ...)"""
|
||||
def set(self, s):
|
||||
if s not in ('ban', 'kick', 'kban') and not s.startswith('mode+') and \
|
||||
not s.startswith('mode-') and not s.startswith('command '):
|
||||
not s.startswith('mode-') and not s.startswith('umode-') and \
|
||||
not s.startswith('umode+') and not s.startswith('command '):
|
||||
self.error()
|
||||
return
|
||||
self.setValue(s)
|
||||
|
|
|
@ -202,7 +202,7 @@ class AttackProtectorTestCase(ChannelPluginTestCase):
|
|||
prefix=self.prefix)
|
||||
self.irc.feedMsg(msg)
|
||||
self.assertNotError('config plugin.AttackProtector.message.punishment '
|
||||
'umode +b')
|
||||
'umode+b')
|
||||
return self._getIfAnswerIsEqual(ircmsgs.IrcMsg(prefix="", command="MODE",
|
||||
args=(self.channel, mode, self.nick)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue