From d061e84cc78c17d107df9e19f25de73cfac8cb15 Mon Sep 17 00:00:00 2001 From: src Date: Tue, 12 Nov 2019 18:42:36 +0530 Subject: [PATCH] Add HttpResponsePermanentRedirect to django.shortcuts (#211) --- django-stubs/shortcuts.pyi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/django-stubs/shortcuts.pyi b/django-stubs/shortcuts.pyi index c9c49be..8ac4501 100644 --- a/django-stubs/shortcuts.pyi +++ b/django-stubs/shortcuts.pyi @@ -1,7 +1,11 @@ from typing import Any, Callable, Dict, List, Optional, Protocol, Sequence, Type, TypeVar, Union from django.db.models.base import Model -from django.http.response import HttpResponse as HttpResponse, HttpResponseRedirect as HttpResponseRedirect +from django.http.response import ( + HttpResponse as HttpResponse, + HttpResponseRedirect as HttpResponseRedirect, + HttpResponsePermanentRedirect as HttpResponsePermanentRedirect, +) from django.db.models import Manager, QuerySet from django.http import HttpRequest @@ -26,7 +30,7 @@ class SupportsGetAbsoluteUrl(Protocol): ... def redirect( to: Union[Callable, str, SupportsGetAbsoluteUrl], *args: Any, permanent: bool = ..., **kwargs: Any -) -> HttpResponseRedirect: ... +) -> Union[HttpResponseRedirect, HttpResponsePermanentRedirect]: ... _T = TypeVar("_T", bound=Model)