I recently removed a step in my viewflow.
Now i am getting 500 errors from coerce_to_related_instance(task, task.flow_task.flow_class.task_class
with the error 'NoneType' object has no attribute 'flow_class'
.
class TaskIterable(ModelIterable):
def __iter__(self):
base_iterator = super(TaskIterable, self).__iter__()
if getattr(self.queryset, '_coerced', False):
for task in base_iterator:
if isinstance(task, self.queryset.model):
print(task)
task = coerce_to_related_instance(task, task.flow_task.flow_class.task_class)
yield task
else:
for task in base_iterator:
yield task
I understand this happens because the task cannot be mapped to a valid task anymore as the old task has been deprecated.
What are my options?
- Keep the old task around so that it can be mapped?
- Run a sql script to update all 'flow_task'?
- ?