Fix error when sanitized have only 1 argument

This commit is contained in:
Mehdi Abaakouk 2012-10-17 11:31:15 +02:00
parent 8419152668
commit c22e73c7f8
1 changed files with 5 additions and 1 deletions

6
lg.py Executable file → Normal file
View File

@ -181,7 +181,11 @@ def page_not_found(e):
return render_template('error.html', warning="The requested URL was not found on the server."), 404
def sanitized(*args):
return tuple( unescape(s) for s in args)
res = tuple( unescape(s) for s in args)
if len(args) == 1:
return res[1]
else:
return res
@app.route("/whois/<query>")
def whois(query):