s/shortcodes/shortlinks/terminology fix

This commit is contained in:
str4d
2014-05-23 13:11:00 +00:00
parent 320dc99bd6
commit 52dd6c1534

View File

@ -2,11 +2,11 @@ from flask import g, redirect, url_for
############ ############
# Shortcodes # Shortlinks
# #
# Two-letter shortcodes are not allowed, they clash with language codes # Two-letter shortlinks are not allowed, they clash with language codes
SHORTCODES={ SHORTLINKS={
'd': {'function': 'downloads_list', 'params': {}}, 'd': {'function': 'downloads_list', 'params': {}},
'get': {'function': 'downloads_list', 'params': {}}, 'get': {'function': 'downloads_list', 'params': {}},
} }
@ -199,8 +199,8 @@ def legacy_show(f):
lang = g.lang lang = g.lang
if lang == 'zh': if lang == 'zh':
lang = 'zh_CN' lang = 'zh_CN'
if f in SHORTCODES: if f in SHORTLINKS:
return redirect(url_for(SHORTCODES[f]['function'], lang=lang, **SHORTCODES[f]['params']), 301) return redirect(url_for(SHORTLINKS[f]['function'], lang=lang, **SHORTLINKS[f]['params']), 301)
elif f in LEGACY_FUNCTIONS_MAP: elif f in LEGACY_FUNCTIONS_MAP:
return redirect(url_for(LEGACY_FUNCTIONS_MAP[f]['function'], lang=lang, **LEGACY_FUNCTIONS_MAP[f]['params']), 301) return redirect(url_for(LEGACY_FUNCTIONS_MAP[f]['function'], lang=lang, **LEGACY_FUNCTIONS_MAP[f]['params']), 301)
elif f in LEGACY_PAGES_MAP: elif f in LEGACY_PAGES_MAP: