mypy: Correct return_success_on_head_request typing.

Also switch to python3 type annotations.
This commit is contained in:
neiljp (Neil Pilgrim) 2017-10-29 14:36:43 -07:00 committed by Tim Abbott
parent 0781237b1f
commit 63335fd8c5
1 changed files with 2 additions and 4 deletions

View File

@ -712,11 +712,9 @@ def rate_limit(domain='all'):
return wrapped_func
return wrapper
def return_success_on_head_request(view_func):
# type: (Callable) -> Callable
def return_success_on_head_request(view_func: Callable[..., HttpResponse]) -> Callable[..., HttpResponse]:
@wraps(view_func)
def _wrapped_view_func(request, *args, **kwargs):
# type: (HttpResponse, *Any, **Any) -> Callable
def _wrapped_view_func(request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
if request.method == 'HEAD':
return json_success()
return view_func(request, *args, **kwargs)