Skip to content

Commit

Permalink
Merge pull request #453 from open-contracting/439-change-lapseable-logic
Browse files Browse the repository at this point in the history
fix: use simpler borrower_submitted_at logic for lapsed applications
  • Loading branch information
jpmckinney authored Jan 6, 2025
2 parents 7778a0d + 1c4a2b5 commit 41cfba9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,7 @@ def lapseable(cls, session: Session) -> "Query[Self]":
),
and_(
cls.status == ApplicationStatus.SUBMITTED,
# col(cls.borrower_submitted_at) + delta < datetime.now(), # noqa: ERA001 # also remove join
col(Message.created_at) + delta < datetime.now(),
col(cls.borrower_submitted_at) + delta < datetime.now(),
Lender.external_onboarding_url != "",
col(cls.borrower_accessed_external_onboarding_at).is_(None),
),
Expand All @@ -788,14 +787,6 @@ def lapseable(cls, session: Session) -> "Query[Self]":
),
),
)
.join(
Message,
and_(
cls.id == Message.application_id,
Message.type == MessageType.BORROWER_EXTERNAL_ONBOARDING_REMINDER,
),
isouter=True,
)
.join(Lender, cls.lender_id == Lender.id, isouter=True)
)

Expand Down

0 comments on commit 41cfba9

Please sign in to comment.