fix: username encoding utf-8

This commit is contained in:
2024-02-19 16:42:46 +01:00
parent 38e60c6898
commit 2b7034df0d

View File

@@ -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()