mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Fixed enable and disable not to allow ValueError through their makeAntiCapability calls.
This commit is contained in:
parent
5296d51dc2
commit
2266faec5f
@ -98,9 +98,13 @@ class AdminCommands(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
else:
|
else:
|
||||||
# This has to know that defaultCapabilties gets turned into a
|
# This has to know that defaultCapabilties gets turned into a
|
||||||
# dictionary.
|
# dictionary.
|
||||||
|
try:
|
||||||
|
capability = ircdb.makeAntiCapability(command)
|
||||||
|
except ValueError:
|
||||||
|
irc.error(msg, '%r is not a valid command.' % command)
|
||||||
|
return
|
||||||
if command in conf.defaultCapabilities:
|
if command in conf.defaultCapabilities:
|
||||||
conf.defaultCapabilities.remove(command)
|
conf.defaultCapabilities.remove(command)
|
||||||
capability = ircdb.makeAntiCapability(command)
|
|
||||||
conf.defaultCapabilities.add(capability)
|
conf.defaultCapabilities.add(capability)
|
||||||
irc.reply(msg, conf.replySuccess)
|
irc.reply(msg, conf.replySuccess)
|
||||||
|
|
||||||
@ -110,7 +114,11 @@ class AdminCommands(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
Re-enables the command <command> for all non-owner users.
|
Re-enables the command <command> for all non-owner users.
|
||||||
"""
|
"""
|
||||||
command = privmsgs.getArgs(args)
|
command = privmsgs.getArgs(args)
|
||||||
anticapability = ircdb.makeAntiCapability(command)
|
try:
|
||||||
|
anticapability = ircdb.makeAntiCapability(command)
|
||||||
|
except ValueError:
|
||||||
|
irc.error(msg, '%r is not a valid command.' % command)
|
||||||
|
return
|
||||||
if anticapability in conf.defaultCapabilities:
|
if anticapability in conf.defaultCapabilities:
|
||||||
conf.defaultCapabilities.remove(anticapability)
|
conf.defaultCapabilities.remove(anticapability)
|
||||||
irc.reply(msg, conf.replySuccess)
|
irc.reply(msg, conf.replySuccess)
|
||||||
|
Loading…
Reference in New Issue
Block a user