User: Fix handling of --capability for unregistered users.

This commit is contained in:
Valentin Lorentz 2013-04-27 10:10:11 +02:00
parent fe540b3620
commit 7253dee3ae
1 changed files with 9 additions and 9 deletions

View File

@ -54,10 +54,10 @@ class User(callbacks.Plugin):
predicates = []
for (option, arg) in optlist:
if option == 'capability':
if arg in conf.supybot.capabilities.private():
try:
u = ircdb.users.getUser(msg.prefix)
if arg in conf.supybot.capabilities.private() and \
not u._checkCapability('admin'):
if not u._checkCapability('admin'):
raise KeyError
except KeyError:
# Note that it may be raised by checkCapability too.