summaryrefslogtreecommitdiff
path: root/django/shortcuts.py
diff options
context:
space:
mode:
authorVytis Banaitis <vytis.banaitis@gmail.com>2017-02-01 18:41:56 +0200
committerTim Graham <timograham@gmail.com>2017-02-01 11:41:56 -0500
commit8838d4dd498c8f66ea4237fe8a79a5f77d6f95c9 (patch)
treeb75fa27930b8758ad36669b523b084ac09ce290b /django/shortcuts.py
parent0ec4dc91e0e7befdd06aa0613b5d0fbe3c785ee7 (diff)
Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.
Diffstat (limited to 'django/shortcuts.py')
-rw-r--r--django/shortcuts.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/django/shortcuts.py b/django/shortcuts.py
index b27a75206f..04e2f3e103 100644
--- a/django/shortcuts.py
+++ b/django/shortcuts.py
@@ -30,7 +30,7 @@ def render(request, template_name, context=None, content_type=None, status=None,
return HttpResponse(content, content_type, status)
-def redirect(to, *args, **kwargs):
+def redirect(to, *args, permanent=False, **kwargs):
"""
Returns an HttpResponseRedirect to the appropriate URL for the arguments
passed.
@@ -47,11 +47,7 @@ def redirect(to, *args, **kwargs):
By default issues a temporary redirect; pass permanent=True to issue a
permanent redirect
"""
- if kwargs.pop('permanent', False):
- redirect_class = HttpResponsePermanentRedirect
- else:
- redirect_class = HttpResponseRedirect
-
+ redirect_class = HttpResponsePermanentRedirect if permanent else HttpResponseRedirect
return redirect_class(resolve_url(to, *args, **kwargs))