Additional error checking on user record deletion

This commit is contained in:
Mark Veidemanis 2019-10-05 18:22:14 +01:00
parent f0fff7c958
commit aa54759337
1 changed files with 5 additions and 2 deletions

View File

@ -115,7 +115,10 @@ def delUser(name, channel, nick, user):
p.srem(namespace, nick) p.srem(namespace, nick)
if channels == {channel.encode()}: if channels == {channel.encode()}:
p.delete(chanspace) p.delete(chanspace)
if user:
p.srem(gnamespace, user) p.srem(gnamespace, user)
else:
warn("Attempt to delete nonexistent user: %s" % user)
else: else:
p.srem(chanspace, channel) p.srem(chanspace, channel)
p.execute() p.execute()