Refactor Query.get() => Session.get() per SQLAlchemy 1.4

This commit is contained in:
Lance Edgar 2023-02-11 22:07:00 -06:00
parent 20ab228032
commit 46f5db7460

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# Rattail -- Retail Software Framework # Rattail -- Retail Software Framework
# Copyright © 2010-2022 Lance Edgar # Copyright © 2010-2023 Lance Edgar
# #
# This file is part of Rattail. # This file is part of Rattail.
# #
@ -65,7 +65,7 @@ class VendorCatalogView(base.VendorCatalogView):
kwargs = super(VendorCatalogView, self).get_batch_kwargs(batch) kwargs = super(VendorCatalogView, self).get_batch_kwargs(batch)
if 'vendor_name' not in kwargs and batch.vendor_id: if 'vendor_name' not in kwargs and batch.vendor_id:
vendor = CoreOfficeSession.query(corepos.Vendor).get(batch.vendor_id) vendor = CoreOfficeSession.get(corepos.Vendor, batch.vendor_id)
if vendor: if vendor:
kwargs['vendor_name'] = vendor.name kwargs['vendor_name'] = vendor.name