Cleanup status transition
Merge pull request #5464 from ticoann/restrict_state_transition

Cleanup status transition