-
Notifications
You must be signed in to change notification settings - Fork 3
Exclude unknown work time from part-time searches #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| from typing import Any | ||
|
|
||
| from .db import connection | ||
| from .employment_filter import profile_requires_confirmed_work_time | ||
| from .job_metadata import classify_job_metadata | ||
|
|
||
| PROFILE_SCHEMA = """ | ||
|
|
@@ -622,6 +623,8 @@ def list_jobs_for_profile( | |
| item["reasons"] = json.loads(item.pop("reasons_json") or "[]") | ||
| item["language_reasons"] = json.loads(item.pop("language_reasons_json") or "[]") | ||
| item.update(classify_job_metadata(item)) | ||
| if profile_requires_confirmed_work_time(profile) and item["employment_type"] == "unknown": | ||
| continue | ||
|
Comment on lines
+626
to
+627
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an upgraded database contains legacy non-excluded rows with genuinely unknown work time, the query selects the newest Useful? React with 👍 / 👎. |
||
| item.pop("description", None) | ||
| item["remote"] = bool(item["remote"]) | ||
| item["role_relevant"] = bool(item["role_relevant"]) | ||
|
|
@@ -632,7 +635,8 @@ def list_jobs_for_profile( | |
| def get_job_for_profile(job_key: str, profile_id: int, user_id: int | None = None) -> dict[str, Any] | None: | ||
| """Return one complete job only when it belongs to the user's search profile.""" | ||
| ensure_profile_schema(user_id) | ||
| if not get_profile(profile_id, user_id=user_id): | ||
| profile = get_profile(profile_id, user_id=user_id) | ||
| if not profile: | ||
| return None | ||
| owner_key = "admin" if user_id is None else f"user:{int(user_id)}" | ||
| with connection() as con: | ||
|
|
@@ -656,6 +660,8 @@ def get_job_for_profile(job_key: str, profile_id: int, user_id: int | None = Non | |
| item["reasons"] = json.loads(item.pop("reasons_json") or "[]") | ||
| item["language_reasons"] = json.loads(item.pop("language_reasons_json") or "[]") | ||
| item.update(classify_job_metadata(item)) | ||
| if profile_requires_confirmed_work_time(profile) and item["employment_type"] == "unknown": | ||
| return None | ||
| item["remote"] = bool(item["remote"]) | ||
| item["role_relevant"] = bool(item["role_relevant"]) | ||
| return item | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed vacancies are hidden when their work time is expressed only as weekly hours, workload percentage,
PART_TIMEprovider metadata, or signals such asStudent Assistant:assess_employment_fitrecognizes these as part-time and can score/notify them, butclassify_job_metadatastill returnsemployment_type == "unknown". This post-query check consequently removes valid matches from the review queue; the filtering decision should reuse the employment assessment or make the metadata classifier recognize the same confirmation signals.Useful? React with 👍 / 👎.