appy.gen: bugfix while comparing values for historization purposes.
This commit is contained in:
parent
4fe5c5e164
commit
e87547b789
|
@ -347,9 +347,14 @@ class BaseMixin:
|
||||||
prev = previousData[field]
|
prev = previousData[field]
|
||||||
appyType = self.getAppyType(field)
|
appyType = self.getAppyType(field)
|
||||||
curr = appyType.getValue(self)
|
curr = appyType.getValue(self)
|
||||||
|
try:
|
||||||
if (prev == curr) or ((prev == None) and (curr == '')) or \
|
if (prev == curr) or ((prev == None) and (curr == '')) or \
|
||||||
((prev == '') and (curr == None)):
|
((prev == '') and (curr == None)):
|
||||||
del previousData[field]
|
del previousData[field]
|
||||||
|
except UnicodeDecodeError, ude:
|
||||||
|
# The string comparisons above may imply silent encoding-related
|
||||||
|
# conversions that may produce this exception.
|
||||||
|
pass
|
||||||
if (appyType.type == 'Ref') and (field in previousData):
|
if (appyType.type == 'Ref') and (field in previousData):
|
||||||
previousData[field] = [r.title for r in previousData[field]]
|
previousData[field] = [r.title for r in previousData[field]]
|
||||||
if previousData:
|
if previousData:
|
||||||
|
|
Loading…
Reference in a new issue