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

Return None, instead of raising AttributeError on MarkupTextDescripto… #66

Merged
merged 1 commit into from Jun 8, 2017

Conversation

reinbach
Copy link
Contributor

@reinbach reinbach commented Jun 5, 2017

Django 1.11.2 get_or_create object is passing in None instance, resulting in the AttributeError exception being raised.

Seeing that a None is returned if field name not in the instance, I thought returning None for no instance would be ok. Tests pass and functionality does not appear to be impacted, so hopefully that is ok.

Tests don't pass for Django 1.11.2, but went ahead and created an explicit test for get_or_create_object.

Thank you for contributing to django-machina! A list of simple rules is available on the online
documentation to help you contribute to this project: https://django-machina.readthedocs.org/en/stable/contributing.html.
Please review these guidelines before submitting your pull request!

…r if no instance

Django 1.11.2 get_or_create object is passing in None instance
@reinbach
Copy link
Contributor Author

reinbach commented Jun 6, 2017

Not sure how/why the changes I made caused travis-ci build to fail.

@ellmetha
Copy link
Owner

ellmetha commented Jun 6, 2017

@reinbach a new version of isort has been released a few days ago and it introduces new rules regarding import ordering. This is the reason why the build is failing. I'll provide a patch in master, so you'll be able to do a rebase in your branch.

@ellmetha
Copy link
Owner

ellmetha commented Jun 8, 2017

Thanks for the fix! 😉

@ellmetha ellmetha merged commit a183fb4 into ellmetha:master Jun 8, 2017
ellmetha pushed a commit that referenced this pull request Jun 8, 2017
…r if no instance (#66)

Django 1.11.2 get_or_create object is passing in None instance
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.

None yet

2 participants