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:
|
for key in j:
|
||||||
val = j[key]
|
val = j[key]
|
||||||
|
jsonb_cnv = ''
|
||||||
|
|
||||||
|
# force postgres to update to jsonb
|
||||||
|
# when the fields ARE jsonb.
|
||||||
if key in json_fields:
|
if key in json_fields:
|
||||||
val = json.dumps(val)
|
val = json.dumps(val)
|
||||||
|
jsonb_cnv = '::jsonb'
|
||||||
|
|
||||||
await app.db.execute(f"""
|
await app.db.execute(f"""
|
||||||
UPDATE user_settings
|
UPDATE user_settings
|
||||||
SET {key}=$1
|
SET {key}=$1{jsonb_cnv}
|
||||||
WHERE id = $2
|
WHERE id = $2
|
||||||
""", val, user_id)
|
""", val, user_id)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ class GatewayWebsocket:
|
||||||
if len(encoded) < 2048:
|
if len(encoded) < 2048:
|
||||||
log.debug('sending\n{}', pprint.pformat(payload))
|
log.debug('sending\n{}', pprint.pformat(payload))
|
||||||
else:
|
else:
|
||||||
# log.debug('sending {}', pprint.pformat(payload))
|
log.debug('sending {}', pprint.pformat(payload))
|
||||||
log.debug('sending op={} s={} t={} (too big)',
|
log.debug('sending op={} s={} t={} (too big)',
|
||||||
payload.get('op'),
|
payload.get('op'),
|
||||||
payload.get('s'),
|
payload.get('s'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue