Fix redirect bug when attempting bulk row delete for nonexistent batch

This commit is contained in:
Lance Edgar 2016-03-22 18:56:48 -05:00
parent f60d304133
commit cd332f2287

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2014 Lance Edgar
# Copyright © 2010-2016 Lance Edgar
#
# This file is part of Rattail.
#
@ -24,7 +24,7 @@
Batch Row Views
"""
from __future__ import unicode_literals
from __future__ import unicode_literals, absolute_import
from pyramid.httpexceptions import HTTPFound
@ -55,7 +55,7 @@ def BatchRowsGrid(request):
uuid = request.matchdict['uuid']
batch = Session.query(Batch).get(uuid) if uuid else None
if not batch:
return HTTPFound(location=request.route_url('batches'))
raise HTTPFound(location=request.route_url('batches'))
class BatchRowsGrid(SearchableAlchemyGridView):