2

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?

  1. Keep the old task around so that it can be mapped?
  2. Run a sql script to update all 'flow_task'?
  3. ?
Tinker
  • 4,165
  • 6
  • 33
  • 72

1 Answers1

1

Yep, generally in order to keep node type info and associated detail task views, you need to keep unconnected flow nodes in your flow class.

General flow updating scenario is just to drop incoming connection but leave it with .Next(..) that would allow a user to complete an existing node.

If it's not possible, flow node task references could be updated during data migration

http://docs.viewflow.io/viewflow_core.html#flow-migration

The PRO version contains special obsolete node that allows dropping outdated nodes, and all node detail views would be performed by obsolete node detail views.

kmmbvnr
  • 5,863
  • 4
  • 35
  • 44