Ignore:
Timestamp:
Sep 9, 2012, 6:43:39 AM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
51b384a
Parents:
c632b1c
git-author:
Alex Dehnert <adehnert@…> (09/09/12 06:42:04)
git-committer:
Alex Dehnert <adehnert@…> (09/09/12 06:43:39)
Message:

Constitutions: sort error messages correctly

It turns out regardless of how sorted your inserts into your dictionary were,
you're not really guaranteed to traverse those keys in a sorted way... This
uses sorted() to get sorted categories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    r04bdacd r71e71e3  
    10361036            successes[const.status_msg].append(const)
    10371037    context = {}
    1038     context['failures'] = failures.items()
    1039     context['successes'] = successes.items()
     1038    context['failures']  = sorted(failures.items(),  key=lambda x: x[0])
     1039    context['successes'] = sorted(successes.items(), key=lambda x: x[0])
    10401040    context['pagename'] = 'groups'
    10411041    return render_to_response('groups/groups_constitutions.html', context, context_instance=RequestContext(request), )
Note: See TracChangeset for help on using the changeset viewer.