Loading poolpay/model/Person.py +12 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Literal, Self from babel.numbers import format_currency from sqlalchemy import select from sqlalchemy.orm import Mapped, mapped_column, relationship from poolpay.model.Base import Base Loading Loading @@ -131,4 +132,14 @@ class Person(Base): If no persons can be found or there are too many plausible matches, None is returned. """ raise NotImplementedError() # TODO Improve heuristics persons = ( db.session.execute(select(cls).where(cls.name == full_name.split(" ")[0])) .scalars() .all() ) if len(persons) != 1: return None return persons[0] Loading
poolpay/model/Person.py +12 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Literal, Self from babel.numbers import format_currency from sqlalchemy import select from sqlalchemy.orm import Mapped, mapped_column, relationship from poolpay.model.Base import Base Loading Loading @@ -131,4 +132,14 @@ class Person(Base): If no persons can be found or there are too many plausible matches, None is returned. """ raise NotImplementedError() # TODO Improve heuristics persons = ( db.session.execute(select(cls).where(cls.name == full_name.split(" ")[0])) .scalars() .all() ) if len(persons) != 1: return None return persons[0]