Skip to content

feat: what a hut offers in the waypoint listings (hut_category) - #2693

Merged
eddy-geek merged 2 commits into
masterfrom
feat/hut-status
Nov 23, 2026
Merged

eddy-geek merged 2 commits into
masterfrom
feat/hut-status

Conversation

@eddy-geek

Copy link
Copy Markdown
Contributor

The waypoint listings give the huts a hut_category, for the map of the site to tell them apart (c2corg/c2c_ui /map, see the Waypoint palette):

  • wardened: a staffed capacity, or open only when wardened (accessible_when_wardened);
  • shelter: no bed (capacity == 0);
  • else the custodianship (always_accessible, no_warden, key_needed).

custodianship alone is not enough: most "always open" huts are wardened ones with a winter room (dev data: 180 of the 237 always_accessible huts have a staffed capacity).

How

  • hut_category() in models/waypoint.py, set on the huts of a listing by set_custom_fields, and given as a special attribute (as img_count).
  • GetDocumentsConfig(load_fields=…): the listing loads capacity, capacity_staffed and custodianship to compute it, without giving them.
  • Not named hut_status: the outings already have one (the special attributes apply to every document type).
  • Cached listings: the cache key holds the cache version of the release.

Tests

The rule (model test, parametrized), and a hut of a listing carrying it without its source fields.

The listings give the huts a hut_category, for the map to tell them apart:
`wardened` with a staffed capacity or when only open when wardened (most
"always open" huts are wardened ones with a winter room), `shelter` without any
bed, else their custodianship. Computed from capacity, capacity_staffed and
custodianship, which the listing loads (load_fields) but does not give.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 14 complexity · 0 duplication

Metric Results
Complexity 14
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@eddy-geek

Copy link
Copy Markdown
Contributor Author

The data question: what is a "wardened" hut?

The custodianship field has four values. Hut counts in the dev database:

custodianship (French label) Huts With a staffed capacity
always_accessible (toujours ouvert) 237 180
no_warden (non gardé) 72 2
accessible_when_wardened (gardé, fermé hors gardiennage) 49 33
key_needed (clé nécessaire) 12 5

"Always open" is mostly wardened huts with an always-open winter room.

wardened = accessible_when_wardened, or a staffed capacity above 0 (unless no_warden)

That gives about 230 wardened (red) and about 140 not wardened (yellow).

@eddy-geek
eddy-geek merged commit 796cd69 into master Nov 23, 2026
2 of 4 checks passed
@eddy-geek
eddy-geek deleted the feat/hut-status branch November 23, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant