mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-14 06:40:38 -05:00
replaced json.dumps with encode_canonical_json
This commit is contained in:
parent
55af207321
commit
812c030e87
1 changed files with 2 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ from ._base import SQLBaseStore
|
||||||
from synapse.api.errors import SynapseError, Codes
|
from synapse.api.errors import SynapseError, Codes
|
||||||
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
||||||
|
|
||||||
|
from canonicaljson import encode_canonical_json
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -46,7 +47,7 @@ class FilteringStore(SQLBaseStore):
|
||||||
defer.returnValue(json.loads(str(def_json).decode("utf-8")))
|
defer.returnValue(json.loads(str(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).encode("utf-8")
|
def_json = encode_canonical_json(user_filter)
|
||||||
|
|
||||||
# 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…
Add table
Add a link
Reference in a new issue