xworkflows icon indicating copy to clipboard operation
xworkflows copied to clipboard

Fix current_state check in ImplementationWrapper._pre_transition_checks

Open Gagaro opened this issue 2 years ago • 0 comments

I had an issue when upgrading to Django 3.2, probably because of the memory isolation of setUpTestData objects.

The issue was that I had a StateWrapper instead of a State object during _pre_transition_checks, which caused an error even if I had the correct state for the transition.

Another issuer was that State instance were not considered equal, probably because they were copied.

The fixes I did are to compare State by name, and to get the State instance inside the StateWrapper if we need to.

Thanks for reviewing this PR :+1: .

Gagaro avatar Apr 05 '22 14:04 Gagaro