use a slightly safer time in migration script. w/ jlantz
This commit is contained in:
parent
6f8528dc1d
commit
c063a4f84c
|
@ -6,4 +6,5 @@ t
|
|||
version_info.json
|
||||
.coverage*
|
||||
UNKNOWN.egg-info/
|
||||
process_models/
|
||||
process_models/
|
||||
.ipynb_checkpoints
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import copy
|
||||
import json
|
||||
import time
|
||||
import uuid
|
||||
from hashlib import sha256
|
||||
|
||||
|
@ -219,9 +218,14 @@ class VersionOneThree:
|
|||
task_models = TaskModel.query.filter(TaskModel.properties_json.like('%last_state_change": null%')).all() # type: ignore
|
||||
for task_model in task_models:
|
||||
parent_task_model = task_model.parent_task_model()
|
||||
last_state_change = time.time()
|
||||
|
||||
# we really don't know what to set this to if there is no parent_task_model,
|
||||
# so let spiff fix it for us by telling it it is out of date
|
||||
last_state_change = 0
|
||||
|
||||
if parent_task_model is not None:
|
||||
last_state_change = parent_task_model.properties_json["last_state_change"]
|
||||
|
||||
task_model.properties_json["last_state_change"] = last_state_change
|
||||
task_model.properties_json["task_spec"] = task_model.task_definition.bpmn_identifier
|
||||
flag_modified(task_model, "properties_json") # type: ignore
|
||||
|
|
Loading…
Reference in New Issue