From: Thadeu Lima de Souza Cascardo Date: Wed, 10 Oct 2007 15:29:06 +0000 (-0300) Subject: Cleaned up schedule view functions X-Git-Url: http://git.cascardo.info/?p=cascardo%2Feventmanager.git;a=commitdiff_plain;h=2a229973cd589d127e697a8bc3b0c2e0e047b682 Cleaned up schedule view functions --- diff --git a/views.py b/views.py index 5c0a8e4..73e5e3e 100644 --- a/views.py +++ b/views.py @@ -420,19 +420,17 @@ def dados_palestra(request, codigo): @enable_login_form def programacao(request): - try: - d = {'aprovadas': Trabalho.objects.filter(aprovado=True).order_by('dia', 'time_start', 'room')} - except ObjectDoesNotExist: - d = {} + ap = Trabalho.objects.filter(aprovado=True) + ord = ap.order_by('dia', 'time_start', 'room') + d = {'aprovadas': ord} return build_response(request, 'programacao.html',d) @enable_login_form @staff_member_required def grade(request): - try: - d = {'aprovadas': Trabalho.objects.filter(aprovado=True).order_by('dia', 'time_start', 'room')} - except ObjectDoesNotExist: - d = {} + ap = Trabalho.objects.filter(aprovado=True) + ord = ap.order_by('dia', 'time_start', 'room') + d = {'aprovadas': ord} return build_response(request, 'grade.html', d) @enable_login_form