From f0e3ba19e8c9045e740d9eba15229145aa125e35 Mon Sep 17 00:00:00 2001 From: Tanshu Date: Thu, 20 Dec 2012 14:28:50 +0530 Subject: [PATCH] Added try/catch on ledger report. --- brewman/brewman/views/reports/ledger.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brewman/brewman/views/reports/ledger.py b/brewman/brewman/views/reports/ledger.py index 7f3ed31b..18712f84 100644 --- a/brewman/brewman/views/reports/ledger.py +++ b/brewman/brewman/views/reports/ledger.py @@ -7,6 +7,7 @@ from pyramid.view import view_config from brewman.models import DBSession from brewman.models.master import LedgerBase +from brewman.models.validation_exception import TryCatchFunction from brewman.models.voucher import Voucher, Journal, VoucherType from brewman.views.services.session import session_period_start, session_period_finish @@ -27,6 +28,7 @@ def show_blank(request): @view_config(request_method='GET', route_name='api_ledger_id', renderer='json', permission='Ledger') +@TryCatchFunction def show_data(request): id = request.matchdict['id'] ledger = LedgerBase.by_id(uuid.UUID(id))