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

Fix Django deprecation warning #165

Merged
merged 2 commits into from
May 23, 2017
Merged

Fix Django deprecation warning #165

merged 2 commits into from
May 23, 2017

Conversation

mattbriancon
Copy link
Contributor

No description provided.

@ezarowny
Copy link
Contributor

Thanks for the PR! I'll take a look.

from django.conf import settings
from django.http import Http404

if django.VERSION >= (1, 10):
Copy link
Contributor

@ezarowny ezarowny May 22, 2017

Choose a reason for hiding this comment

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

Hmm, I'm not sure if this is the right way to do this particular comparison. django.VERSION usually has text in it. For example, (1, 11, 1, u'final', 0).

I know this is probably not necessary and really corner case-y, but I think it might be better to do an import check similar to how we handle MiddlewareMixin below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the link. That's definitely something to consider since a method could change to a property and vice-versa. I'm going to file an internal ticket to discuss with the team.

@mattbriancon
Copy link
Contributor Author

Updated to use try/except.

Copy link
Contributor

@ezarowny ezarowny left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for contributing!

I filed an internal ticket for us to discuss selecting version-specific behavior using django.VERSION in the future.

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.

2 participants