# HG changeset patch # User souliane # Date 1433855990 -7200 # Node ID 6250b65523c6b8990bcf9090c3caef394872b412 # Parent 13ebb548f2346fc01c5d1efa4590570cb0091c61 categories' aliases can be defined to be able to use "French" links like adhesion.html diff -r 13ebb548f234 -r 6250b65523c6 sat_website/views.py --- a/sat_website/views.py Tue Jun 09 14:55:09 2015 +0200 +++ b/sat_website/views.py Tue Jun 09 15:19:50 2015 +0200 @@ -52,6 +52,10 @@ ("social_contract", _(u"Social contract")), ]) +CATEGORIES_ALIASES = {"adhesion": "membership", + "adhesion_form": "membership_form", + } + CATEGORIES_HIDDEN = ('membership_form', 'thank_you') PROJECTS_INFOS = {'sat': _(u'contains the backend, Primitivus and Jp'), @@ -65,6 +69,9 @@ return render_to_response('sat_website/overview.html') def generic_cat(request, category): + if category in CATEGORIES_ALIASES: + category = CATEGORIES_ALIASES[category] + context = RequestContext(request, { "available_languages": ['fr', 'en'], "categories": CATEGORIES,