from lark import ParseError
-from html.response import redirect, response
+from html_output.response import redirect, response
from parser import parser
qs_dict = parse_qs(os.environ['QUERY_STRING'], encoding='koi8-r')
if tree[0] == 'NAME': # Single tag - just do redirect
tag = tree[1]
assert isinstance(tag, str)
- from tags import tag_exists
- if tag_exists(tag):
+ from tags import real_tag
+ rtag = real_tag(tag)
+ if rtag:
redirect(
- "/Russian/blog/tags/%s.html" % tag, status="301 Moved")
+ "/Russian/blog/tags/%s.html" % rtag.replace(' ', '_'),
+ status="301 Moved")
sys.exit()
status = "404 Tag not found"
title = "Ошибка!"