-
Notifications
You must be signed in to change notification settings - Fork 27
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
Getting an AttributeError when using validates decorator with AssertionError #28
Comments
Exceptions in Python 3 no longer contain a `msg` attribute. Instead the exception message is accessible from the exception object directly. In order to maintain Python 2 support, attempt to fetch the message from `e.msg` and use `str(e)` as a default if the attribtue does not exist. Fixes ColtonProvias#28
Exceptions in Python 3 no longer contain a `msg` attribute. Instead the exception message is accessible from the exception object directly. In order to maintain Python 2 support, attempt to fetch the message from `e.msg` and use `str(e)` as a default if the attribute does not exist. Fixes ColtonProvias#28
Exceptions in Python 3 no longer contain a `msg` attribute. Instead the exception message is accessible from the exception object directly. In order to maintain Python 2 support, attempt to fetch the message from `e.msg` and use `str(e)` as a default if the attribute does not exist. Fixes ColtonProvias#28
It's actually just bad code. Python 2 has btw, I'm helping Colton get patches reviewed and landed. I just started helping out. Sorry this issue and patch have been sitting for awhile. |
When adding model field validation with sqlalchemy's
@validates
decorator as illustrated in the docs I get the errorAttributeError: 'AssertionError' object has no attribute 'msg'
. It seemssqlalchemy-jsonapi
is trying to access the exception message throughe.msg
where it should be accessible throughe
directly. I'm assuming this change happened with Python 3?The text was updated successfully, but these errors were encountered: