changeset 78:6250b65523c6

categories' aliases can be defined to be able to use "French" links like adhesion.html
author souliane <souliane@mailoo.org>
date Tue, 09 Jun 2015 15:19:50 +0200
parents 13ebb548f234
children 6652924221ba
files sat_website/views.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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,