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

fix(django): patch staticmethods in views #1246

Merged
merged 2 commits into from Mar 6, 2020

Conversation

majorgreys
Copy link
Collaborator

@majorgreys majorgreys commented Mar 5, 2020

Fixes #1234

We added instrumentation to trace Django class-based views in 0.34.0. Unfortunately the way we were patching the view methods did not work when a method was specified as a static method.

This is due to how the wrapt library we vendor resolves attributes to be wrapped using getattr. The solution here is a workaround for how we are using wrapt. I opened GrahamDumpleton/wrapt#153 to confirm this actual behavior is unexpected and that our workaround is correct.

@majorgreys majorgreys requested a review from a team as a code owner March 5, 2020 18:32
brettlangdon
brettlangdon previously approved these changes Mar 5, 2020
@brettlangdon brettlangdon merged commit f880b6e into master Mar 6, 2020
@brettlangdon brettlangdon deleted the majorgreys/django-staticmethods branch March 6, 2020 14:27
majorgreys added a commit that referenced this pull request Mar 6, 2020
Co-authored-by: Brett Langdon <brett.langdon@datadoghq.com>
@majorgreys majorgreys added this to the 0.35.0 milestone Mar 10, 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.

ClassView method with static method
2 participants