Take a Platsbanken region in the API and the CLI, and trust its and Teamtailor's posted date
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
43f0210b88
commit
0458c9c172
4 files changed
+12
-5
No files matched your search
+4
-2
@@ -95,7 +95,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|||||||
searches_sub = searches.add_subparsers(dest="action", required=True)
|
searches_sub = searches.add_subparsers(dest="action", required=True)
|
||||||
search_add = searches_sub.add_parser(
|
search_add = searches_sub.add_parser(
|
||||||
"add", help="run a search once, then save it for every pull (or update it)")
|
"add", help="run a search once, then save it for every pull (or update it)")
|
||||||
search_add.add_argument("provider", choices=["jobindex", "adzuna"])
|
search_add.add_argument("provider", choices=["jobindex", "adzuna", "platsbanken"])
|
||||||
search_add.add_argument("name", help='what to call it, e.g. "Copenhagen backend"')
|
search_add.add_argument("name", help='what to call it, e.g. "Copenhagen backend"')
|
||||||
search_add.add_argument("--q", required=True,
|
search_add.add_argument("--q", required=True,
|
||||||
help="the query, in the provider's own syntax")
|
help="the query, in the provider's own syntax")
|
||||||
@@ -104,6 +104,8 @@ def build_parser() -> argparse.ArgumentParser:
|
|||||||
search_add.add_argument("--country", default="",
|
search_add.add_argument("--country", default="",
|
||||||
help="adzuna country: gb, de, nl, fr, at, be, es, it, pl, ch")
|
help="adzuna country: gb, de, nl, fr, at, be, es, it, pl, ch")
|
||||||
search_add.add_argument("--where", default="", help="adzuna place, e.g. Berlin")
|
search_add.add_argument("--where", default="", help="adzuna place, e.g. Berlin")
|
||||||
|
search_add.add_argument("--region", default="",
|
||||||
|
help="platsbanken län id: CaRE_1nn_cSU is Skåne, empty all of Sweden")
|
||||||
search_add.add_argument("--pages", type=int, default=0,
|
search_add.add_argument("--pages", type=int, default=0,
|
||||||
help="result pages per pull (default 5, at most 10)")
|
help="result pages per pull (default 5, at most 10)")
|
||||||
searches_sub.add_parser("list", help="every saved search and its open roles")
|
searches_sub.add_parser("list", help="every saved search and its open roles")
|
||||||
@@ -423,7 +425,7 @@ def add_search(config: config_mod.Config, store: Store, args: argparse.Namespace
|
|||||||
try:
|
try:
|
||||||
params = jobs.sources.search_params(args.provider, args.q, area=args.area,
|
params = jobs.sources.search_params(args.provider, args.q, area=args.area,
|
||||||
country=args.country, where=args.where,
|
country=args.country, where=args.where,
|
||||||
pages=args.pages)
|
region=args.region, pages=args.pages)
|
||||||
sub, found, complete = jobs.sources.save_search(config, store, args.provider, args.name,
|
sub, found, complete = jobs.sources.save_search(config, store, args.provider, args.name,
|
||||||
params)
|
params)
|
||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
|
|||||||
+5
-1
@@ -681,12 +681,16 @@ AFFINITY = range(-1, 3)
|
|||||||
#: deployment carries no Adzuna key (`plugins.search`'s own docstring:
|
#: deployment carries no Adzuna key (`plugins.search`'s own docstring:
|
||||||
#: "not yet run live") and no Adzuna subscription exists to fetch.
|
#: "not yet run live") and no Adzuna subscription exists to fetch.
|
||||||
#:
|
#:
|
||||||
|
#: - `teamtailor`: the feed's `pubDate`, and `platsbanken`: `publication_date`,
|
||||||
|
#: both named as publication. Read on live feeds on 2026-09-29, where the
|
||||||
|
#: dates were spread over weeks, not checked against stored roles.
|
||||||
|
#:
|
||||||
#: A host not listed here, or a role whose stored `published_at` fails the
|
#: A host not listed here, or a role whose stored `published_at` fails the
|
||||||
#: sanity check in `posted_at`, keeps `first_seen` as its posted date — the
|
#: sanity check in `posted_at`, keeps `first_seen` as its posted date — the
|
||||||
#: safe default this migration is replacing everywhere else.
|
#: safe default this migration is replacing everywhere else.
|
||||||
TRUSTED_POSTED_HOSTS: frozenset[str] = frozenset({
|
TRUSTED_POSTED_HOSTS: frozenset[str] = frozenset({
|
||||||
"greenhouse", "lever", "ashby", "workable", "smartrecruiters", "recruitee",
|
"greenhouse", "lever", "ashby", "workable", "smartrecruiters", "recruitee",
|
||||||
"personio", "jobindex", "adzuna",
|
"personio", "teamtailor", "jobindex", "adzuna", "platsbanken",
|
||||||
})
|
})
|
||||||
|
|
||||||
#: A `published_at` before this is a parsing slip or a placeholder, not a
|
#: A `published_at` before this is a parsing slip or a placeholder, not a
|
||||||
|
|||||||
+2
-1
@@ -538,6 +538,7 @@ class SearchBody(BaseModel):
|
|||||||
area: int = 0
|
area: int = 0
|
||||||
country: str = ""
|
country: str = ""
|
||||||
where: str = ""
|
where: str = ""
|
||||||
|
region: str = ""
|
||||||
pages: Annotated[int, Field(ge=0, le=10)] = 0
|
pages: Annotated[int, Field(ge=0, le=10)] = 0
|
||||||
|
|
||||||
|
|
||||||
@@ -545,7 +546,7 @@ def _params(body: SearchBody) -> dict[str, Any]:
|
|||||||
try:
|
try:
|
||||||
return jobs.sources.search_params(body.provider, body.q, area=body.area,
|
return jobs.sources.search_params(body.provider, body.q, area=body.area,
|
||||||
country=body.country, where=body.where,
|
country=body.country, where=body.where,
|
||||||
pages=body.pages)
|
region=body.region, pages=body.pages)
|
||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
raise HTTPException(422, str(exc)) from exc
|
raise HTTPException(422, str(exc)) from exc
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -732,7 +732,7 @@ def test_the_agents_page_lists_and_edits_search_agents(client: TestClient) -> No
|
|||||||
template = page[page.index('<template id="agent-form-template">'):page.index("</template>")]
|
template = page[page.index('<template id="agent-form-template">'):page.index("</template>")]
|
||||||
assert 'id="agent-form"' in template and 'id="a-cancel"' in template
|
assert 'id="agent-form"' in template and 'id="a-cancel"' in template
|
||||||
assert 'id="a-name"' in page and 'placeholder="My search"' in page
|
assert 'id="a-name"' in page and 'placeholder="My search"' in page
|
||||||
assert 'id="a-intent"' in page and "<details" in page and 'id="a-gates"' in page
|
assert 'id="a-prompts"' in page and "<details" in page and 'id="a-gates"' in page
|
||||||
for weight in ("a-fit", "a-recency", "a-affinity", "a-taste"):
|
for weight in ("a-fit", "a-recency", "a-affinity", "a-taste"):
|
||||||
assert f'id="{weight}"' in page
|
assert f'id="{weight}"' in page
|
||||||
assert 'id="a-taste" min="0" step="0.05" value="0.2"' in page
|
assert 'id="a-taste" min="0" step="0.05" value="0.2"' in page
|
||||||
|
|||||||
Reference in new issue
Block a user