Skip to content

Commit 29bcc8f

Browse files
SRChiPRanuka Perera
authored and
Ranuka Perera
committed
Add HttpResponsePermanentRedirect to django.shortcuts
1 parent 87d59c7 commit 29bcc8f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

django-stubs/shortcuts.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
from typing import Any, Callable, Dict, List, Optional, Protocol, Sequence, Type, TypeVar, Union
22

33
from django.db.models.base import Model
4-
from django.http.response import HttpResponse as HttpResponse, HttpResponseRedirect as HttpResponseRedirect
4+
from django.http.response import (
5+
HttpResponse as HttpResponse,
6+
HttpResponseRedirect as HttpResponseRedirect,
7+
HttpResponsePermanentRedirect as HttpResponsePermanentRedirect,
8+
)
59

610
from django.db.models import Manager, QuerySet
711
from django.http import HttpRequest
@@ -26,7 +30,7 @@ class SupportsGetAbsoluteUrl(Protocol): ...
2630

2731
def redirect(
2832
to: Union[Callable, str, SupportsGetAbsoluteUrl], *args: Any, permanent: bool = ..., **kwargs: Any
29-
) -> HttpResponseRedirect: ...
33+
) -> Union[HttpResponseRedirect, HttpResponsePermanentRedirect]: ...
3034

3135
_T = TypeVar("_T", bound=Model)
3236

0 commit comments

Comments
 (0)