Commit 4871b5a1 authored by Zenon Mousmoulas's avatar Zenon Mousmoulas

Sort the institution list in the participants view, using request.LANGUAGE_CODE

for language aware collation

Rather risky stuff, definitely revisit...
parent 8afd614d
......@@ -5,6 +5,7 @@ import bz2
import math
import datetime
from xml.etree import ElementTree
import locale
from django.shortcuts import render_to_response, redirect, render
from django.http import (
......@@ -1680,6 +1681,10 @@ def participants(request):
dets.append(i.institutiondetails)
if i.get_active_cat_enrl():
cat_exists = True
locale.setlocale(locale.LC_COLLATE, [request.LANGUAGE_CODE, 'UTF-8'])
dets.sort(cmp=locale.strcoll,
key=lambda x: unicode(x.institution.
get_name(lang=request.LANGUAGE_CODE)))
return render_to_response(
'front/participants.html',
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment