misc: do not migrate empty strings to python conditions (#22466)
This commit is contained in:
parent
fe2b701f7d
commit
392039216a
|
@ -1526,12 +1526,18 @@ class PageField(Field):
|
|||
def migrate(self):
|
||||
changed = super(PageField, self).migrate()
|
||||
if isinstance(self.condition, basestring):
|
||||
self.condition = {'type': 'python', 'value': self.condition}
|
||||
if self.condition:
|
||||
self.condition = {'type': 'python', 'value': self.condition}
|
||||
else:
|
||||
self.condition = {}
|
||||
changed = True
|
||||
for post_condition in self.post_conditions or []:
|
||||
condition = post_condition.get('condition')
|
||||
if isinstance(condition, basestring):
|
||||
post_condition['condition'] = {'type': 'python', 'value': condition}
|
||||
if condition:
|
||||
post_condition['condition'] = {'type': 'python', 'value': condition}
|
||||
else:
|
||||
post_condition['condition'] = {}
|
||||
changed = True
|
||||
return changed
|
||||
|
||||
|
|
|
@ -132,7 +132,10 @@ class JumpWorkflowStatusItem(WorkflowStatusJumpItem):
|
|||
def migrate(self):
|
||||
changed = super(JumpWorkflowStatusItem, self).migrate()
|
||||
if isinstance(self.condition, basestring):
|
||||
self.condition = {'type': 'python', 'value': self.condition}
|
||||
if self.condition:
|
||||
self.condition = {'type': 'python', 'value': self.condition}
|
||||
else:
|
||||
self.condition = {}
|
||||
changed = True
|
||||
return changed
|
||||
|
||||
|
|
Loading…
Reference in New Issue