Handle a null suffix properly.
- Legacy-Id: 417
This commit is contained in:
parent
16b718c917
commit
9594e1ec82
|
@ -16,10 +16,14 @@ def redirect(request, path="", script=""):
|
||||||
try:
|
try:
|
||||||
cmd = redir.commands.all().get(command=request.REQUEST['command'])
|
cmd = redir.commands.all().get(command=request.REQUEST['command'])
|
||||||
if cmd.url:
|
if cmd.url:
|
||||||
rest = cmd.url + "/" + cmd.suffix.rest
|
rest = cmd.url + "/"
|
||||||
else:
|
else:
|
||||||
rest = cmd.suffix.rest
|
rest = ""
|
||||||
remove = cmd.suffix.remove
|
if cmd.suffix:
|
||||||
|
rest = rest + cmd.suffix.rest
|
||||||
|
remove = cmd.suffix.remove
|
||||||
|
else:
|
||||||
|
remove = ""
|
||||||
except Command.DoesNotExist:
|
except Command.DoesNotExist:
|
||||||
pass # it's ok, there's no more-specific request.
|
pass # it's ok, there's no more-specific request.
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
Loading…
Reference in a new issue