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

AttributeError while raising Exception "TransitionCannotStart" #81

Open
brot opened this issue Jan 11, 2016 · 0 comments
Open

AttributeError while raising Exception "TransitionCannotStart" #81

brot opened this issue Jan 11, 2016 · 0 comments

Comments

@brot
Copy link
Contributor

brot commented Jan 11, 2016

If you are using another name than state for your StateField, the TransitionCannotStart Exception raises AttributeError, because instance.state is not defined

https://github.com/vikingco/django-states2/blob/master/django_states/exceptions.py#L46

class TransitionCannotStart(TransitionException):
    def __init__(self, instance, transition):
        TransitionException.__init__(self, "Transition '%s' on %s cannot start in the state '%s'" %
                    (transition, instance.__class__.__name__, instance.state))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant