Skip to content

Commit

Permalink
chore: Prefer type() to __class__
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jul 16, 2024
1 parent 93135cf commit 544b9c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 544b9c2

Please sign in to comment.