From 9cf5e491effe2ed987d99344e9a13baa0a77dcba Mon Sep 17 00:00:00 2001 From: Andy Babic Date: Fri, 21 Jan 2022 11:57:33 +0000 Subject: [PATCH] Improve readability of urlparse path extraction --- wagtail/contrib/redirects/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wagtail/contrib/redirects/models.py b/wagtail/contrib/redirects/models.py index 15003892a6..cb5b25245c 100644 --- a/wagtail/contrib/redirects/models.py +++ b/wagtail/contrib/redirects/models.py @@ -158,8 +158,7 @@ class Redirect(models.Model): return "" # Extract the path from the rest of the value - url_parsed = urlparse(url) - path = url_parsed[2] + path = urlparse(url).path if path == "/": return ""