mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2025-12-09 15:58:32 +01:00
fix: encoding problems and optional contact info
This commit is contained in:
10
interface.py
10
interface.py
@@ -65,7 +65,7 @@ def get_dispatch():
|
|||||||
dispatch_by_person[dobj.username] += "\n{}".format(dobj.message)
|
dispatch_by_person[dobj.username] += "\n{}".format(dobj.message)
|
||||||
dispatch_secrets.append(dobj.dispatch_secret)
|
dispatch_secrets.append(dobj.dispatch_secret)
|
||||||
|
|
||||||
response = [ { "person" : str(tupel[0]),
|
response = [ { "person" : tupel[0].decode("utf-8"),
|
||||||
"message" : tupel[1],
|
"message" : tupel[1],
|
||||||
"method" : method,
|
"method" : method,
|
||||||
"uids" : dispatch_secrets
|
"uids" : dispatch_secrets
|
||||||
@@ -74,9 +74,11 @@ def get_dispatch():
|
|||||||
# add phone numbers and emails #
|
# add phone numbers and emails #
|
||||||
for obj in response:
|
for obj in response:
|
||||||
for person in dispatch_objects:
|
for person in dispatch_objects:
|
||||||
if obj.username == obj["person"]:
|
if obj["person"] == person.username.decode("utf-8"):
|
||||||
obj.update({ "email" : person.email })
|
if person.email:
|
||||||
obj.update({ "phone" : person.phone })
|
obj.update({ "email" : person.email.decode("utf-8") })
|
||||||
|
if person.phone:
|
||||||
|
obj.update({ "phone" : person.phone.decode("utf-8") })
|
||||||
|
|
||||||
return flask.jsonify(response)
|
return flask.jsonify(response)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user