Refactor Query.get()
=> Session.get()
per SQLAlchemy 1.4
This commit is contained in:
parent
15ea726b9b
commit
4c64dbc536
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2022 Lance Edgar
|
||||
# Copyright © 2010-2023 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -82,7 +82,8 @@ class HarvestUserView(HarvestMasterView):
|
|||
person_display = ""
|
||||
if self.request.method == 'POST':
|
||||
if self.request.POST.get('person_uuid'):
|
||||
person = self.Session.query(model.Person).get(self.request.POST['person_uuid'])
|
||||
person = self.Session.get(model.Person,
|
||||
self.request.POST['person_uuid'])
|
||||
if person:
|
||||
person_display = str(person)
|
||||
elif self.editing:
|
||||
|
@ -114,7 +115,7 @@ class HarvestUserView(HarvestMasterView):
|
|||
def valid_person(self, node, value):
|
||||
model = self.model
|
||||
if value:
|
||||
person = self.Session.query(model.Person).get(value)
|
||||
person = self.Session.get(model.Person, value)
|
||||
if not person:
|
||||
raise colander.Invalid(node, "Person not found (you must *select* a record)")
|
||||
|
||||
|
|
Loading…
Reference in a new issue