Exclude archived jobs from auto mail matching
This commit is contained in:
parent
ec3a338170
commit
2ebe7d8aed
@ -35,6 +35,11 @@ def find_matching_job(msg: MailMessage) -> Optional[Job]:
|
|||||||
|
|
||||||
q = Job.query
|
q = Job.query
|
||||||
|
|
||||||
|
# Never auto-match archived jobs.
|
||||||
|
# Archived jobs should remain historical and must not receive new mail links/runs.
|
||||||
|
if hasattr(Job, "archived"):
|
||||||
|
q = q.filter(Job.archived.is_(False))
|
||||||
|
|
||||||
if norm_from is None:
|
if norm_from is None:
|
||||||
q = q.filter(Job.from_address.is_(None))
|
q = q.filter(Job.from_address.is_(None))
|
||||||
else:
|
else:
|
||||||
@ -86,6 +91,8 @@ def find_matching_job(msg: MailMessage) -> Optional[Job]:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
q2 = Job.query
|
q2 = Job.query
|
||||||
|
if hasattr(Job, "archived"):
|
||||||
|
q2 = q2.filter(Job.archived.is_(False))
|
||||||
if norm_from is None:
|
if norm_from is None:
|
||||||
q2 = q2.filter(Job.from_address.is_(None))
|
q2 = q2.filter(Job.from_address.is_(None))
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
This file documents all changes made to this project via Claude Code.
|
This file documents all changes made to this project via Claude Code.
|
||||||
|
|
||||||
|
## [2026-03-12]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Prevented automatic mail-to-job matching from selecting archived jobs:
|
||||||
|
- Updated `app/job_matching.py` so `find_matching_job()` excludes `jobs.archived = true`.
|
||||||
|
- Applied the same archived filter in the VSPC normalized fallback match path.
|
||||||
|
- This prevents new imports/re-parse auto-approval from attaching messages/runs to archived jobs.
|
||||||
|
|
||||||
## [2026-03-02]
|
## [2026-03-02]
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user