From 2b7034df0d740b47f7636d31e2ce0668d1830df7 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Mon, 19 Feb 2024 16:42:46 +0100 Subject: [PATCH] fix: username encoding utf-8 --- server/interface.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/server/interface.py b/server/interface.py index 25b7faa..b04b319 100755 --- a/server/interface.py +++ b/server/interface.py @@ -165,13 +165,12 @@ def get_dispatch(): dispatch_objects = lines_timeout.filter(DispatchObject.method==method).all() - # get matchin "any" methods # - if method == user_settings.get_highest_prio_method(): - dispatch_objects_any = lines_timeout.filter(DispatchObject.method=="any").all() - for d in dispatch_objects_any: - user_settings = db.session.query(UserSettings).filter(UserSettings.username==d.username).first() - if user_settings and user_settings.get_highest_prio_method() == method: - dispatch_objects += d + dispatch_objects_any = lines_timeout.filter(DispatchObject.method=="any").all() + for d in dispatch_objects_any: + user_str = str(d.usernames, "utf-8") + user_settings = db.session.query(UserSettings).filter(UserSettings.username==user_str).first() + if user_settings and user_settings.get_highest_prio_method() == method: + dispatch_objects += [d] else: dispatch_objects = lines_timeout.all()