Skip to content

Conversation

blueyed
Copy link

@blueyed blueyed commented Sep 19, 2017

This allows for validation on the model level for a transition that is
about to happen (via form.is_valid).
Raising ValidationError via validate_fsm_state_change allows for
Django handling it properly, instead for when the ValidationError would
be raised from the transition function itself.

Ref: django/django#9113
Ref: viewflow/django-fsm#120

This allows for validation on the model level for a transition that is
about to happen (via `form.is_valid`).
Raising ValidationError via `validate_fsm_state_change` allows for
Django handling it properly, instead for when the ValidationError would
be raised from the transition function itself.
@blueyed blueyed changed the title Call model's validate_fsm_state_change via Form.is_valid [RFC] Call model's validate_fsm_state_change via Form.is_valid Sep 19, 2017
@blueyed
Copy link
Author

blueyed commented Sep 20, 2017

It might also be possible and better to just set a property on the instance, which then could be used in the models clean method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant