Groupe prit en charge dans la recherche globale
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / context_processors.py
1 # -*- encoding: utf-8 -*-
2
3 import re
4
5 DISCIPLINE_REGION_RE = re.compile(r'/(discipline/(?P<discipline>\d+)/)?(region/(?P<region>\d+)/)?')
6 def discipline_region(request):
7 match = DISCIPLINE_REGION_RE.match(request.path)
8 discipline = match.group('discipline')
9 region = match.group('region')
10 discipline = discipline and int(discipline)
11 region = region and int(region)
12 return dict(discipline_active=discipline, region_active=region)