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

Move guardian imports out of compat #6054

Merged
merged 1 commit into from Jul 6, 2018

Conversation

rpkilby
Copy link
Member

@rpkilby rpkilby commented Jun 22, 2018

Supersedes #6038. The check now just ensures guardian is present in the INSTALLED_APPS, without attempting an import. Since this check is called during runtime by the framework, we won't trigger a "Django is not configured" error.

@rpkilby rpkilby added this to the 3.8.3 Release milestone Jun 22, 2018
Copy link
Contributor

@blueyed blueyed left a comment

Yeah, import rest_framework.serializers now works.

I wonder if we should have some kind of integration test for this, i.e. call python -c 'import rest_framework.serializers' as a tox command, maybe in testenv:dist and a new testenv:dist-base?

except ImportError:
pass
# django-guardian is optional and only imported if in INSTALLED_APPS.
def is_guardian_installed():
Copy link
Contributor

@blueyed blueyed Jun 23, 2018

Choose a reason for hiding this comment

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

Maybe use a __doc__ comment here?

Copy link
Collaborator

@carltongibson carltongibson Jul 6, 2018

Choose a reason for hiding this comment

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

@rpkilby ⬆️😉

auvipy
auvipy approved these changes Jun 28, 2018
@carltongibson carltongibson modified the milestones: 3.8.3 Release, 3.9 Release Jul 6, 2018
Copy link
Collaborator

@carltongibson carltongibson left a comment

This is super-duper. Good work!

@carltongibson carltongibson merged commit 9b8af04 into encode:master Jul 6, 2018
1 check passed
@rpkilby rpkilby deleted the guardian-import branch Jul 6, 2018
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
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.

None yet

4 participants