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

Type error in DjangoObjectPermissionsFilter on Python 3.4 : unorderable types: list() >= tuple() #4005

Closed
5 of 6 tasks
bibenga opened this issue Mar 19, 2016 · 10 comments
Closed
5 of 6 tasks

Comments

@bibenga
Copy link

bibenga commented Mar 19, 2016

Checklist

  • I have verified that that issue exists against the master branch of Django REST framework.
  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • This is not a usage question. (Those should be directed to the discussion group instead.)
  • This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
  • I have reduced the issue to the simplest possible case.
  • I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)

Steps to reproduce

  1. Use latest version on django-guardian 1.4.2
  2. djangorestframework 3.3.3

on Python 3.4

File "/rest_framework/filters.py", line 309, in filter_queryset
if guardian.VERSION >= (1, 3):
TypeError: unorderable types: list() >= tuple()

on Python 2.7

guardian.VERSION >= (1, 3) always False

currently in filters.py:309 -
if guardian.VERSION >= (1, 3):

on python 2.7 always False

replace to -
if guardian.VERSION >= [1, 3]:

Expected behavior

Filtered result

Actual behavior

Exception occurred on Python 3.4
All object showed on Python 2.7

@xordoquy
Copy link
Collaborator

At the moment our tests are run against Django-Guardian 1.3.2
I guess we could bump the version there and see if it still works.

@auvipy
Copy link
Member

auvipy commented Mar 29, 2016

same issue. I'm facing while upgrading drf-extensions to djano 1.9 drf 3.3.3 gurdian 1.4.2
rest_framework/filters.py", line 309, in filter_queryset
if guardian.VERSION >= (1, 3):
TypeError: unorderable types: list() >= tuple()

@auvipy
Copy link
Member

auvipy commented Mar 29, 2016

django-guardian/django-guardian@501695a

@auvipy
Copy link
Member

auvipy commented Mar 31, 2016

as far guardian the issue is actually django guardian specific and been fixed in master

@xordoquy
Copy link
Collaborator

@auvipy thanks for reporting. I'm closing this issue, we'll bump the guardian version in some time.

@auvipy
Copy link
Member

auvipy commented Mar 31, 2016

the fixed version is unreleased yet :/ facing lot of trouble with drf-extensions 1.9 support :(

@xordoquy
Copy link
Collaborator

The thing is, if we change the tuple in favor of a list, we'll break already working guardians. I don't really see another solution here.

@auvipy
Copy link
Member

auvipy commented Mar 31, 2016

exactly

@khasanovbi
Copy link
Contributor

We also had this error at production...

@tomchristie tomchristie added this to the 3.3.4 Release milestone May 26, 2016
@tomchristie
Copy link
Member

Milestoning to increase the priority of this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants