Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to change it but checking the version is a pretty common pattern:
DRF: https://github.com/encode/django-rest-framework/blob/5ba2368ff9b64bef6eced25985bc2fc5bbd08a90/rest_framework/compat.py#L130-L151
There was a problem hiding this comment.
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.