From 8838d4dd498c8f66ea4237fe8a79a5f77d6f95c9 Mon Sep 17 00:00:00 2001 From: Vytis Banaitis Date: Wed, 1 Feb 2017 18:41:56 +0200 Subject: Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments. --- django/shortcuts.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'django/shortcuts.py') 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)) -- cgit v1.3