Skip to content

Commit 9594e1e

Browse files
committed
Handle a null suffix properly.
- Legacy-Id: 417
1 parent 16b718c commit 9594e1e

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

ietf/redirects/views.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ def redirect(request, path="", script=""):
1616
try:
1717
cmd = redir.commands.all().get(command=request.REQUEST['command'])
1818
if cmd.url:
19-
rest = cmd.url + "/" + cmd.suffix.rest
19+
rest = cmd.url + "/"
2020
else:
21-
rest = cmd.suffix.rest
22-
remove = cmd.suffix.remove
21+
rest = ""
22+
if cmd.suffix:
23+
rest = rest + cmd.suffix.rest
24+
remove = cmd.suffix.remove
25+
else:
26+
remove = ""
2327
except Command.DoesNotExist:
2428
pass # it's ok, there's no more-specific request.
2529
except KeyError:

0 commit comments

Comments
 (0)