Fix var.CASEMAPPING error during db upgrade
This commit is contained in:
parent
fe9877f471
commit
75b386917e
@ -182,10 +182,13 @@ def irc_lower(nick):
|
|||||||
"^": "~",
|
"^": "~",
|
||||||
}
|
}
|
||||||
|
|
||||||
if var.CASEMAPPING == "strict-rfc1459":
|
# var.CASEMAPPING may not be defined yet in some circumstances (like database upgrades)
|
||||||
mapping.pop("^")
|
# if so, default to rfc1459
|
||||||
elif var.CASEMAPPING == "ascii":
|
if hasattr(var, "CASEMAPPING"):
|
||||||
mapping = {}
|
if var.CASEMAPPING == "strict-rfc1459":
|
||||||
|
mapping.pop("^")
|
||||||
|
elif var.CASEMAPPING == "ascii":
|
||||||
|
mapping = {}
|
||||||
|
|
||||||
return nick.lower().translate(str.maketrans(mapping))
|
return nick.lower().translate(str.maketrans(mapping))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user