Skip to content

Add fast_abstentions field and fix Dormition Fast fish-exception bug - #164

Merged
brianglass merged 3 commits into
mainfrom
fasting-abstentions-and-dormition-fix
Aug 7, 2026
Merged

Add fast_abstentions field and fix Dormition Fast fish-exception bug#164
brianglass merged 3 commits into
mainfrom
fasting-abstentions-and-dormition-fix

Conversation

@brianglass

Copy link
Copy Markdown
Owner

Summary

  • Adds a new fast_abstentions field (e.g. ['meat', 'fish', 'dairy', 'eggs']) derived from fast_level/fast_exception, as a simpler alternative to fast_exception_desc's traditional "X is allowed" phrasing for readers unfamiliar with it. Purely additive to the API; version bumped 1.11.2. The readings page now shows both allowances and abstentions when there's a fast.
  • Fixes a real fasting-logic bug found while building this, reported directly against production: Aug 9, 2026 showed a fish day on our site but antiochian.org/goarch.org show wine-and-oil only. Root cause: the Dormition Fast's Typikon has no rank-based fish exception (unlike the Apostles'/Nativity fasts), but _apply_fasting_adjustments() didn't enforce that — so a hand-baked rich fast_exception on a Dormition Fast row stuck regardless of its own feast_level. Fixed with a cap in the Dormition Fast case (mirroring the existing Apostles'/Nativity downgrade pattern), not by editing the affected saint's data — St Herman of Alaska's Vigil rank is real and untouched; only the wrong assumption that rank alone grants fish during this particular fast is corrected. Caught a second, previously-unnoticed instance of the same mistake for free: the Leavetaking of the Transfiguration (Aug 13).
  • A separate, unrelated Greek-tradition data error on the same Aug 9 row (fast_exception baked onto a row with feast_level=0, no feast at all) is fixed directly in fixtures/calendarium.json.

Test plan

  • Full test suite (docker compose run --rm tests): 140 tests, only the pre-existing unrelated test_translation_changes_passage_content flake (confirmed present on a clean main baseline before this branch).
  • Verified live in-browser: readings page shows allowances + abstentions together; Greek tradition Aug 9, 2026 now matches antiochian.org/goarch.org.
  • Verified via API (curl /api/gregorian/...) that fast_abstentions is present and correct.
  • Verified Herman of Alaska (Aug 9) and Leavetaking of Transfiguration (Aug 13) both now show "Wine and Oil are Allowed" across multiple years/weekdays for both traditions, while Transfiguration itself (Aug 6) is unaffected.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hf6j2xXQXywHVh3HAVRxB3

brianglass and others added 3 commits August 6, 2026 11:24
Add a new fast_abstentions field (list of food categories to abstain
from, e.g. ['meat', 'fish', 'dairy', 'eggs']) derived from fast_level
and fast_exception -- a simpler alternative to fast_exception_desc's
traditional "X is allowed" phrasing for readers unfamiliar with it.
Purely additive to the API (version bumped 1.1 -> 1.2); the readings
page now shows both allowances and abstentions when there's a fast.

While building this, a user report ("our page shows a fish day for
Aug 9, 2026 but antiochian.org/goarch.org show wine-and-oil only")
led to a real fasting-logic bug: the Dormition Fast's Typikon has no
rank-based fish exception (unlike the Apostles'/Nativity fasts, where
Ch. 32-33 grants one to Vigil-rank feasts) -- it's strict throughout
except for one dated exception, the Transfiguration itself (Aug 6).
_apply_fasting_adjustments() didn't enforce that, so any Dormition
Fast row carrying a hand-baked rich fast_exception (regardless of its
own feast_level) stayed that way. This affected St Herman of Alaska's
Vigil-rank feast (Aug 9) and, caught for free by the same general
rule, the previously-unnoticed Leavetaking of the Transfiguration
(Aug 13). Fixed with a cap in the Dormition Fast case (mirroring the
existing Apostles'/Nativity downgrade pattern) rather than editing
the affected rows' data -- Herman's Vigil rank is real and un-touched;
only the wrong assumption that rank alone grants fish is corrected.

A separate, unrelated Greek-tradition data error on the same Aug 9
row (fast_exception baked onto a row with feast_level=0, no feast at
all to justify it) is fixed directly in fixtures/calendarium.json,
since that value reflected no underlying fact worth preserving.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hf6j2xXQXywHVh3HAVRxB3
…ontent to flake

The feed view is wrapped in cache_page (calendarium/api_urls.py), backed
by a real FileBasedCache outside local dev -- local_settings.py's
DummyCache override is gitignored and never present in CI. Django's
TestCase only rolls back the database between tests, not this cache, so
an earlier test in FeedTest hitting the same URL at real wall-clock time
(test_links, test_links_greek, etc.) would poison the cache for whichever
test ran later and requested it -- including
test_translation_changes_passage_content's @freeze_time request, which
would silently get served that stale, non-frozen body instead of content
reflecting its own frozen date. This is why the failure showed up
depending on what day CI happened to run, unrelated to any code change.

Clear the cache in FeedTest.setUp() so every test in the class starts
clean regardless of execution order.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hf6j2xXQXywHVh3HAVRxB3
The previous run got stuck in a corrupted "queued" state during a
GitHub Actions infra outage (Service Unavailable errors resolving
action download info); this branch's concurrency group cancels the
stale run and starts a clean one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hf6j2xXQXywHVh3HAVRxB3
@brianglass
brianglass merged commit ff8d0ee into main Aug 7, 2026
4 checks passed
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