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

Import coreapi directly instead of from DRF #526

Merged
merged 1 commit into from
Oct 22, 2016

Conversation

rpkilby
Copy link
Collaborator

@rpkilby rpkilby commented Oct 20, 2016

Fixes #525.

This is ultimately an interaction between DRF+django-filter+django-guardian, which results in the following:

  File "lib/python2.7/site-packages/django_filters/compat.py", line 19, in <module>
    from rest_framework.compat import coreapi
  File "lib/python2.7/site-packages/rest_framework/compat.py", line 210, in <module>
    import guardian.shortcuts  # Fixes #1624
  File "lib/python2.7/site-packages/guardian/shortcuts.py", line 6, in <module>
    from django.contrib.auth.models import Group, Permission

Importing coreapi directly, instead of through DRF prevents the import to django-guardian.

Copy link

@afiaka87 afiaka87 left a comment

Choose a reason for hiding this comment

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

This passes by any standard. Should be merged asap to fix bug for all the folks using django-filters with drf 3.5

@carltongibson carltongibson added this to the 1.0 milestone Oct 22, 2016
@carltongibson carltongibson merged commit c7e4888 into carltongibson:develop Oct 22, 2016
@rpkilby rpkilby deleted the fix-guardian-compat branch October 22, 2016 11:18
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.

3 participants