sql: ignore non-dict values for block fields (#53065)

This commit is contained in:
Frédéric Péters 2021-04-13 15:03:50 +02:00
parent 26085c1190
commit e1c5bffbc2
1 changed files with 1 additions and 1 deletions

View File

@ -1681,7 +1681,7 @@ class SqlMixin:
value = datetime.datetime(value.tm_year, value.tm_mon, value.tm_mday)
elif sql_type == 'bytea':
value = bytearray(pickle.dumps(value, protocol=2))
elif sql_type == 'jsonb' and value.get('schema'):
elif sql_type == 'jsonb' and isinstance(value, dict) and value.get('schema'):
# block field, adapt date/field values
value = copy.deepcopy(value)
for field_id, field_type in value.get('schema').items():