From 544b9c242638d9fb4dae2f337ee096a0ff662b03 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Mon, 15 Jul 2024 23:00:57 -0400 Subject: [PATCH] chore: Prefer type() to __class__ --- app/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models.py b/app/models.py index dcf3201b..28af98f6 100644 --- a/app/models.py +++ b/app/models.py @@ -499,12 +499,13 @@ def rejecter_lenders(self, session: Session) -> list[Self]: """ :return: The IDs of lenders who rejected applications from the application's borrower for the same award. """ + cls = type(self) return ( session.query(Application.lender_id) .filter( - self.__class__.award_borrower_identifier == self.award_borrower_identifier, - self.__class__.status == ApplicationStatus.REJECTED, - col(self.__class__.lender_id).isnot(None), + cls.award_borrower_identifier == self.award_borrower_identifier, + cls.status == ApplicationStatus.REJECTED, + col(cls.lender_id).isnot(None), ) .distinct() .all()