Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 7253dee3aee7b6608050576a629a33a891f6d002 1 parent fe540b3
Valentin Lorentz authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 plugins/User/plugin.py
18 plugins/User/plugin.py
View
@@ -54,15 +54,15 @@ def list(self, irc, msg, args, optlist, glob):
predicates = []
for (option, arg) in optlist:
if option == 'capability':
- try:
- u = ircdb.users.getUser(msg.prefix)
- if arg in conf.supybot.capabilities.private() and \
- not u._checkCapability('admin'):
- raise KeyError
- except KeyError:
- # Note that it may be raised by checkCapability too.
- irc.error(_('This is a private capability. Only admins '
- 'can see who has it.'), Raise=True)
+ if arg in conf.supybot.capabilities.private():
+ try:
+ u = ircdb.users.getUser(msg.prefix)
+ if not u._checkCapability('admin'):
+ raise KeyError
+ except KeyError:
+ # Note that it may be raised by checkCapability too.
+ irc.error(_('This is a private capability. Only admins '
+ 'can see who has it.'), Raise=True)
def p(u, cap=arg):
try:
return u._checkCapability(cap)
Please sign in to comment.
Something went wrong with that request. Please try again.