Added try/catch on ledger report.

This commit is contained in:
Tanshu 2012-12-20 14:28:50 +05:30
parent d28029672f
commit f0e3ba19e8

View File

@ -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))