Skip to content

Conversation

@PIG208
Copy link
Contributor

@PIG208 PIG208 commented Aug 27, 2022

csrf_protect and etc. are created via the decorator_from_middleware
helper, which doesn't modify the original signature of the wrapped view
function. Using TypeVar helps preserve the original type of the
decorated callable.

Related implementation in Django: https://github.com/django/django/blob/b92ffebb0cdc469baaf1b8f0e72dddb069eb2fb4/django/utils/decorators.py#L117-L162

Related issues

None

PIG208 added 2 commits August 27, 2022 13:14
csrf_protect and etc. are created via the decorator_from_middleware
helper, which doesn't modify the original signature of the wrapped view
function. Using TypeVar helps preserve the original type of the
decorated callable.

Signed-off-by: Zixuan James Li <[email protected]>
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

@sobolevn sobolevn merged commit 11ded9d into typeddjango:master Aug 27, 2022
@PIG208 PIG208 deleted the csrf branch August 27, 2022 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants