mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 10:04:56 -04:00
Reduce unnecessary whitespace in JSON. (#7372)
This commit is contained in:
parent
2ffd6783c7
commit
4dd27e6d11
15 changed files with 56 additions and 53 deletions
|
@ -16,12 +16,11 @@
|
|||
|
||||
from typing import List, Tuple
|
||||
|
||||
from canonicaljson import json
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.storage._base import SQLBaseStore, db_to_json
|
||||
from synapse.util import json_encoder
|
||||
|
||||
# The category ID for the "default" category. We don't store as null in the
|
||||
# database to avoid the fun of null != null
|
||||
|
@ -752,7 +751,7 @@ class GroupServerStore(GroupServerWorkerStore):
|
|||
if profile is None:
|
||||
insertion_values["profile"] = "{}"
|
||||
else:
|
||||
update_values["profile"] = json.dumps(profile)
|
||||
update_values["profile"] = json_encoder.encode(profile)
|
||||
|
||||
if is_public is None:
|
||||
insertion_values["is_public"] = True
|
||||
|
@ -783,7 +782,7 @@ class GroupServerStore(GroupServerWorkerStore):
|
|||
if profile is None:
|
||||
insertion_values["profile"] = "{}"
|
||||
else:
|
||||
update_values["profile"] = json.dumps(profile)
|
||||
update_values["profile"] = json_encoder.encode(profile)
|
||||
|
||||
if is_public is None:
|
||||
insertion_values["is_public"] = True
|
||||
|
@ -1007,7 +1006,7 @@ class GroupServerStore(GroupServerWorkerStore):
|
|||
"group_id": group_id,
|
||||
"user_id": user_id,
|
||||
"valid_until_ms": remote_attestation["valid_until_ms"],
|
||||
"attestation_json": json.dumps(remote_attestation),
|
||||
"attestation_json": json_encoder.encode(remote_attestation),
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -1131,7 +1130,7 @@ class GroupServerStore(GroupServerWorkerStore):
|
|||
"is_admin": is_admin,
|
||||
"membership": membership,
|
||||
"is_publicised": is_publicised,
|
||||
"content": json.dumps(content),
|
||||
"content": json_encoder.encode(content),
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -1143,7 +1142,7 @@ class GroupServerStore(GroupServerWorkerStore):
|
|||
"group_id": group_id,
|
||||
"user_id": user_id,
|
||||
"type": "membership",
|
||||
"content": json.dumps(
|
||||
"content": json_encoder.encode(
|
||||
{"membership": membership, "content": content}
|
||||
),
|
||||
},
|
||||
|
@ -1171,7 +1170,7 @@ class GroupServerStore(GroupServerWorkerStore):
|
|||
"group_id": group_id,
|
||||
"user_id": user_id,
|
||||
"valid_until_ms": remote_attestation["valid_until_ms"],
|
||||
"attestation_json": json.dumps(remote_attestation),
|
||||
"attestation_json": json_encoder.encode(remote_attestation),
|
||||
},
|
||||
)
|
||||
else:
|
||||
|
@ -1240,7 +1239,7 @@ class GroupServerStore(GroupServerWorkerStore):
|
|||
keyvalues={"group_id": group_id, "user_id": user_id},
|
||||
updatevalues={
|
||||
"valid_until_ms": attestation["valid_until_ms"],
|
||||
"attestation_json": json.dumps(attestation),
|
||||
"attestation_json": json_encoder.encode(attestation),
|
||||
},
|
||||
desc="update_remote_attestion",
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue