Draft: migrate DraftText type to Text

This commit is contained in:
vocx-fc
2020-06-19 16:11:11 -05:00
committed by Yorik van Havre
parent 5f88fa2ebb
commit 0f30c8ba2b

View File

@@ -125,8 +125,18 @@ class DraftAnnotation(object):
"""
if state:
if isinstance(state, dict) and ("Type" in state):
# During the migration of the classes
# the 'DraftText' type was changed to 'Text' type
if state["Type"] == "DraftText":
state["Type"] = "Text"
_info = "migrate 'DraftText' type to 'Text'"
_wrn("v0.19, " + _tr(_info))
self.Type = state["Type"]
else:
if state == "DraftText":
state = "Text"
_info = "migrate 'DraftText' type to 'Text'"
_wrn("v0.19, " + _tr(_info))
self.Type = state
def execute(self, obj):