javrasya / django-river

Django workflow library that supports on the fly changes ⛵
BSD 3-Clause "New" or "Revised" License
741 stars 105 forks source link

Update function.rst #163

Closed AngelLiang closed 4 years ago

AngelLiang commented 4 years ago

When I test the hook function example function in django-river-v3.2.0, it will raise following execption:

'TransitionApprovalMeta' object has no attribute 'source_state'
Traceback (most recent call last):
  ...
    self.callback_function.get()(context)
  File "<string>", line 46, in _wrapper
  File "<string>", line 39, in handle
  File "<string>", line 10, in _handle_my_transitions
AttributeError: 'TransitionApprovalMeta' object has no attribute 'source_state'

I think maybe some api have changed and document have not updated in time. Please check it, thank you.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 80.92% when pulling 085a97b63ed00503ab8ed73f62fa0352451cf9c8 on AngelLiang:patch-1 into f58df9fa931339be6afc7dd99db58590ae27b4c2 on javrasya:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 80.92% when pulling 085a97b63ed00503ab8ed73f62fa0352451cf9c8 on AngelLiang:patch-1 into f58df9fa931339be6afc7dd99db58590ae27b4c2 on javrasya:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 80.92% when pulling 085a97b63ed00503ab8ed73f62fa0352451cf9c8 on AngelLiang:patch-1 into f58df9fa931339be6afc7dd99db58590ae27b4c2 on javrasya:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 80.92% when pulling 085a97b63ed00503ab8ed73f62fa0352451cf9c8 on AngelLiang:patch-1 into f58df9fa931339be6afc7dd99db58590ae27b4c2 on javrasya:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 80.92% when pulling 085a97b63ed00503ab8ed73f62fa0352451cf9c8 on AngelLiang:patch-1 into f58df9fa931339be6afc7dd99db58590ae27b4c2 on javrasya:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 80.92% when pulling 085a97b63ed00503ab8ed73f62fa0352451cf9c8 on AngelLiang:patch-1 into f58df9fa931339be6afc7dd99db58590ae27b4c2 on javrasya:master.

javrasya commented 4 years ago

Hi @AngelLiang ,

It is a very good catch. Thank you for your contribution. Our practice is usually to reproduce this in a test that shows it breaks then fix it. I will try to provide a test in your branch and then merge it.