misc: repair dictionary attributes left as bytes (#39318)
This commit is contained in:
parent
7a663969bf
commit
7bcdac0413
|
@ -409,6 +409,16 @@ class Field(object):
|
|||
self.display_locations.append('listings')
|
||||
changed = True
|
||||
self.in_listing = None
|
||||
if six.PY3:
|
||||
# repair dictionary attributes that may have been kept as bytes in
|
||||
# the initial python 2 -> 3 conversion.
|
||||
from wcs.qommon.storage import deep_bytes2str
|
||||
for key in ('prefill', 'data_source'):
|
||||
value = getattr(self, key, None)
|
||||
if not value:
|
||||
continue
|
||||
if b'type' in value:
|
||||
setattr(self, key, deep_bytes2str(getattr(self, key)))
|
||||
return changed
|
||||
|
||||
def evaluate_condition(self, dict_vars, formdef, condition):
|
||||
|
|
Loading…
Reference in New Issue