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

Django 1.8 compatibility #1263

Merged
merged 1 commit into from Apr 7, 2015
Merged

Conversation

willembult
Copy link
Contributor

transaction.commit_on_success and Options.module_name are deprecated in Django 1.7 and will be removed in 1.8

return getattr(meta, 'model_name', meta.module_name)

# commit_on_success replaced by atomic in Django >=1.8
atomic_decorator = getattr(django.db.transaction, 'atomic', django.db.transaction.commit_on_success)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look in the Travis output, this line causes an error on Django 1.8. This is because the third parameter to getattr() is evaluated whether 'atomic' is found or not, and django.db.transaction.commit_on_success doesn't exist in 1.8.

Perhaps:

atomic_decorator = getattr(django.db.transaction, 'atomic') or getattr(django.db.transaction, 'commit_on_success')

@willembult
Copy link
Contributor Author

@georgedorn thanks, fixed

@georgedorn
Copy link
Contributor

We still have failures under Django 1.8. (https://travis-ci.org/toastdriven/django-tastypie/builds/44896068). Travis is currently ignoring those as allowed failures. @toastdriven: I think this is something only you can fix; it's also set to ignore failures for Django 1.7, which is bad.

So this PR fixes the @atomic vs @commit_on_success compatibility issue and silences deprecation warnings on 1.6 and 1.7, but reveals other areas where TastyPie may have issues on 1.8. We could merge this and accept that 1.8 is still broken, or at least the tests are.

@georgedorn georgedorn mentioned this pull request Feb 19, 2015
@georgedorn georgedorn merged commit d5cc1f4 into django-tastypie:master Apr 7, 2015
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