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

exchange/utils: check whether commit_unless_managed is available on current django installation #30

Closed

Conversation

flavianmissi
Copy link

Fixes #29


from django import VERSION
# see https://docs.djangoproject.com/en/1.9/internals/deprecation/#deprecation-removed-in-1-8
if VERSION[2] < 7:
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the contribution. How about:

from distutils.version import StrictVersion
from django import get_version

if StrictVersion(get_version()) >= StrictVersion('1.6.0'):
    with transaction.atomic():
         ....

https://docs.djangoproject.com/en/1.6/topics/db/transactions/#controlling-transactions-explicitly

On the other hand maybe we should not support < Django 1.6 at all.

Copy link
Author

Choose a reason for hiding this comment

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

Hey, sorry for taking so long to see this!
I'll update this, can remove the version check if we should drop 1.6.

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.

'module' object has no attribute 'commit_unless_managed'
2 participants