Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Call model's validate_fsm_state_change via Form.is_valid #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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