From 2266faec5fa448ecd5645c1d8f55aac90e7bcf43 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 6 Sep 2003 18:37:22 +0000 Subject: [PATCH] Fixed enable and disable not to allow ValueError through their makeAntiCapability calls. --- src/AdminCommands.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/AdminCommands.py b/src/AdminCommands.py index 954c4a6da..db9e229b0 100755 --- a/src/AdminCommands.py +++ b/src/AdminCommands.py @@ -98,9 +98,13 @@ class AdminCommands(privmsgs.CapabilityCheckingPrivmsg): else: # This has to know that defaultCapabilties gets turned into a # dictionary. + try: + capability = ircdb.makeAntiCapability(command) + except ValueError: + irc.error(msg, '%r is not a valid command.' % command) + return if command in conf.defaultCapabilities: conf.defaultCapabilities.remove(command) - capability = ircdb.makeAntiCapability(command) conf.defaultCapabilities.add(capability) irc.reply(msg, conf.replySuccess) @@ -110,7 +114,11 @@ class AdminCommands(privmsgs.CapabilityCheckingPrivmsg): Re-enables the command for all non-owner users. """ 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: conf.defaultCapabilities.remove(anticapability) irc.reply(msg, conf.replySuccess)