Added a few legacy pages (and distinguished them from pages that are now functions)
This commit is contained in:
@ -4,16 +4,24 @@ from flask import g, redirect, url_for
|
|||||||
##############
|
##############
|
||||||
# Legacy paths
|
# Legacy paths
|
||||||
|
|
||||||
LEGACY_MAP={
|
LEGACY_FUNCTIONS_MAP={
|
||||||
'download': 'downloads_list'
|
'download': 'downloads_list'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LEGACY_PAGES_MAP={
|
||||||
|
'bounties': 'volunteer/bounties',
|
||||||
|
'getinvolved': 'volunteer',
|
||||||
|
'faq': 'support/faq',
|
||||||
|
}
|
||||||
|
|
||||||
def legacy_show(f):
|
def legacy_show(f):
|
||||||
lang = 'en'
|
lang = 'en'
|
||||||
if hasattr(g, 'lang') and g.lang:
|
if hasattr(g, 'lang') and g.lang:
|
||||||
lang = g.lang
|
lang = g.lang
|
||||||
if f in LEGACY_MAP:
|
if f in LEGACY_FUNCTIONS_MAP:
|
||||||
return redirect(url_for(LEGACY_MAP[f], lang=lang))
|
return redirect(url_for(LEGACY_FUNCTIONS_MAP[f], lang=lang))
|
||||||
|
elif f in LEGACY_PAGES_MAP:
|
||||||
|
return redirect(url_for('site_show', lang=lang, page=LEGACY_PAGES_MAP[f]))
|
||||||
else:
|
else:
|
||||||
return redirect(url_for('site_show', lang=lang, page=f))
|
return redirect(url_for('site_show', lang=lang, page=f))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user