mirror of https://gitlab.com/litecord/litecord.git
user.settings: force jsonb conversion
This commit is contained in:
parent
b7028d4a7d
commit
bcd846d779
|
|
@ -31,13 +31,17 @@ async def patch_current_settings():
|
|||
|
||||
for key in j:
|
||||
val = j[key]
|
||||
jsonb_cnv = ''
|
||||
|
||||
# force postgres to update to jsonb
|
||||
# when the fields ARE jsonb.
|
||||
if key in json_fields:
|
||||
val = json.dumps(val)
|
||||
jsonb_cnv = '::jsonb'
|
||||
|
||||
await app.db.execute(f"""
|
||||
UPDATE user_settings
|
||||
SET {key}=$1
|
||||
SET {key}=$1{jsonb_cnv}
|
||||
WHERE id = $2
|
||||
""", val, user_id)
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class GatewayWebsocket:
|
|||
if len(encoded) < 2048:
|
||||
log.debug('sending\n{}', pprint.pformat(payload))
|
||||
else:
|
||||
# log.debug('sending {}', pprint.pformat(payload))
|
||||
log.debug('sending {}', pprint.pformat(payload))
|
||||
log.debug('sending op={} s={} t={} (too big)',
|
||||
payload.get('op'),
|
||||
payload.get('s'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue