-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
DjangoGuardianObjectPermissionsFilter Broken on django 1.11 with python 2.7 #6577
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
Comments
We don't test against older Django-guardian versions so there might be other incompatibilities. |
Can I suggest that you add a warning into the code in the python2 path as currently the code returns a rather confusing error message that guardian is not installed. You have to dig into the code to find out the information about the incompatibility |
@carltongibson do you think we'll have releases before merging Python 2.7 removal PR ? |
Yeah. good. I had basically thought no. But it might be worth throwing this in quick... Thoughts? |
Almost everything merged since 3.9.2 has either been a docs fix or a minor code cleanup. We could release 3.9.3 if it's not too much trouble. Maybe change the check to: if six.PY2 and guardian.VERSION >= (1, 5):
return False From #6054, there were issues importing |
OK. Let’s reopen to assess. I’ve been putting off dropping Python 2, so we may as well look at taking advantage of that. Happy to look at a PR adjusting the compat code here. I don’t mind doing the release. |
It might be more like: if six.PY2 and django.version >= (2, 2) and guardian.VERSION >= (1, 5):
return False |
This line unconditionally disables django-guardian from being detected with python 2.7 but it should still work with older releases that don't meet the conditions in the comments:
django-rest-framework/rest_framework/compat.py
Line 172 in 29cbe57
The text was updated successfully, but these errors were encountered: