mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-27 06:29:24 -05:00
Encode the filter JSON as UTF-8 before storing in the database.
Because we are using a binary column type to store the filter JSON.
This commit is contained in:
parent
a059760954
commit
6296590bf7
@ -34,10 +34,10 @@ class FilteringStore(SQLBaseStore):
|
|||||||
desc="get_user_filter",
|
desc="get_user_filter",
|
||||||
)
|
)
|
||||||
|
|
||||||
defer.returnValue(json.loads(def_json))
|
defer.returnValue(json.loads(def_json.decode("utf-8")))
|
||||||
|
|
||||||
def add_user_filter(self, user_localpart, user_filter):
|
def add_user_filter(self, user_localpart, user_filter):
|
||||||
def_json = json.dumps(user_filter)
|
def_json = json.dumps(user_filter).encode("utf-8")
|
||||||
|
|
||||||
# Need an atomic transaction to SELECT the maximal ID so far then
|
# Need an atomic transaction to SELECT the maximal ID so far then
|
||||||
# INSERT a new one
|
# INSERT a new one
|
||||||
|
Loading…
Reference in New Issue
Block a user