mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2026-04-26 23:32:29 +02:00
fix: handle bytes input from ldap better
This commit is contained in:
@@ -398,6 +398,15 @@ def save_in_dispatch_queue(persons, title, message, method, link=""):
|
|||||||
dispatch_secret = secrets.token_urlsafe(32)
|
dispatch_secret = secrets.token_urlsafe(32)
|
||||||
|
|
||||||
master_method = "any"
|
master_method = "any"
|
||||||
|
|
||||||
|
# handle bytes input #
|
||||||
|
def normalize(v):
|
||||||
|
return v.decode("utf-8") if isinstance(v, bytes) else v
|
||||||
|
|
||||||
|
p.username = normalize(p.username)
|
||||||
|
p.phone = normalize(p.phone)
|
||||||
|
p.email = normalize(p.email)
|
||||||
|
|
||||||
obj = DispatchObject(username=p.username,
|
obj = DispatchObject(username=p.username,
|
||||||
phone=p.phone,
|
phone=p.phone,
|
||||||
email=p.email,
|
email=p.email,
|
||||||
|
|||||||
Reference in New Issue
Block a user