Add additional error handling in user queries
This commit is contained in:
parent
81b0450904
commit
5ee53ace4c
|
@ -149,10 +149,11 @@ def getUserByNick(name, nick):
|
||||||
return main.r.hget(mapspace, nick)
|
return main.r.hget(mapspace, nick)
|
||||||
else:
|
else:
|
||||||
warn("Entry doesn't exist: %s on %s - attempting auxiliary lookup" % (nick, mapspace))
|
warn("Entry doesn't exist: %s on %s - attempting auxiliary lookup" % (nick, mapspace))
|
||||||
#return Falsedd
|
#return False
|
||||||
# legacy code below - remove when map is reliable
|
# legacy code below - remove when map is reliable
|
||||||
usermatch = main.r.sscan(gnamespace, match=escape(nick)+"!*", count=-1)
|
usermatch = main.r.sscan(gnamespace, match=escape(nick)+"!*", count=-1)
|
||||||
if usermatch[1] == []:
|
if usermatch[1] == []:
|
||||||
|
warn("No matches found for user query: %s on %s" % (nick, name))
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
if len(usermatch[1]) == 1:
|
if len(usermatch[1]) == 1:
|
||||||
|
@ -184,6 +185,8 @@ def renameUser(name, oldnick, olduser, newnick, newuser):
|
||||||
|
|
||||||
def delUserByNick(name, channel, nick): # kick
|
def delUserByNick(name, channel, nick): # kick
|
||||||
user = getUserByNick(name, nick)
|
user = getUserByNick(name, nick)
|
||||||
|
if not user:
|
||||||
|
return
|
||||||
delUser(name, channel, nick, user)
|
delUser(name, channel, nick, user)
|
||||||
|
|
||||||
def delUserByNetwork(name, nick, user): # quit
|
def delUserByNetwork(name, nick, user): # quit
|
||||||
|
|
Loading…
Reference in New Issue