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

Fixed #31077 -- Made debug decorators raise TypeError if they're not called. #12196

Merged

Conversation

bmispelon
Copy link
Member

… decorators.

Django will now raise an error if you forget to
call the decorator:

@sensitive_variables
def my_function(*args):
    ...

ticket-31077

@bmispelon bmispelon force-pushed the ticket-31077-safeguard-debug-decorators branch from cdd98de to 0fed094 Compare December 9, 2019 11:39
@felixxm felixxm self-assigned this Dec 10, 2019
Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@bmispelon Thanks for this patch 👍

django/views/decorators/debug.py Outdated Show resolved Hide resolved
django/views/decorators/debug.py Outdated Show resolved Hide resolved
tests/view_tests/tests/test_debug.py Outdated Show resolved Hide resolved
tests/view_tests/tests/test_debug.py Outdated Show resolved Hide resolved
tests/view_tests/tests/test_debug.py Outdated Show resolved Hide resolved
@felixxm felixxm changed the title Fixed #31077 -- Added a safeguard to prevent incorrect usage of debug… Fixed #31077 -- Made debug decorators raise TypeError if they're not called. Dec 10, 2019
@bmispelon bmispelon force-pushed the ticket-31077-safeguard-debug-decorators branch from 0fed094 to 7cc3dfb Compare December 10, 2019 11:41
@bmispelon
Copy link
Member Author

Thanks for the review 👍

I've made the suggested changes and force-pushed the changes to this branch.

…called.

Django will raise an error if you forget to call the decorator.
@felixxm felixxm force-pushed the ticket-31077-safeguard-debug-decorators branch from 7cc3dfb to d8e2333 Compare December 10, 2019 12:36
@felixxm felixxm merged commit d8e2333 into django:master Dec 10, 2019
@bmispelon bmispelon deleted the ticket-31077-safeguard-debug-decorators branch December 10, 2019 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants