-
Notifications
You must be signed in to change notification settings - Fork 41
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
make_transition on unsaved fails #23
Comments
Thanks for the bug report! Indeed, we assumed that an object needs to be saved before running any state transitions on it. I will throw an exception instead. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem:
If I have log_transitions = True in my state machine, and then make_transition on an unsaved model object, we crash since 'self' (model object) doesn't have an id but an id is assumed here:
model_methods.py, method make_transition, line 151:
_state_log_model.objects.create(
on=self,
Discussion:
Perhaps we could have an explicit exception for this case, stating that the object needs an id/to be saved beforehand.
The text was updated successfully, but these errors were encountered: