Fixed issue where if type=='html' and no content the app would bork

This commit is contained in:
Gilberto Gonçalves
2013-11-18 23:14:38 +00:00
parent a83f7ccfca
commit 436c54f8e3
+15 -15
View File
@@ -20,22 +20,22 @@ def fuck_gpl3():
content = get_readable_content_from_url(url)
print url
if type == 'html':
print url
markdown_url_contents = _markdown_to_html(content)
return render_template(
'index.html',
converted_url_contents=markdown_url_contents,
page_url=url,
)
else:
if url:
if content:
return content, 200, {'Content-Type': 'text/x-markdown; charset=UTF-8'}
else:
return '404 Not Found', 404
if url:
if not content:
return '404 Not Found', 404
if type == 'html':
print url
markdown_url_contents = _markdown_to_html(content)
return render_template(
'index.html',
converted_url_contents=markdown_url_contents,
page_url=url,
)
else:
return render_template('index.html')
return content, 200, {'Content-Type': 'text/x-markdown; charset=UTF-8'}
else:
return render_template('index.html')
if __name__ == '__main__':