Files
AdventureLog/documentation/docs
Sean Morley 42785f1925 v0.12.1 version update + itinerary validation fixes (#1158)
* fix(itinerary): suppress false-positive UniqueTogetherValidator in CollectionItineraryItemSerializer (#1157)

DRF 3.15 inspects `UniqueConstraint` entries from `Model._meta.constraints`
and auto-generates `UniqueTogetherValidator` objects for them, but strips
each constraint's `condition` argument in the process.

The `CollectionItineraryItem` model has two conditional constraints:
- `unique_order_per_collection_day`: unique `(collection, date, order)`
  only when `is_global=False AND date IS NOT NULL`
- `unique_order_per_collection_global`: unique `(collection, order)`
  only when `is_global=True`

Without their conditions, DRF turns the second constraint into a validator
that checks `(collection, order)` across *all* rows regardless of type.
This means adding any dated itinerary item (transportation, lodging, etc.)
with `order=0` is rejected with 400 whenever a trip-wide (global) item
already holds `order=0` for the same collection — which is almost always,
since global items start at order 0.

Fix: set `validators = []` on the serializer Meta to suppress the
incorrectly-stripped validators. The view already adjusts `order` to avoid
real conflicts within each group, and the DB-level constraints continue
to enforce conditional uniqueness correctly.

This actually fixes #1153 for me

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(release): update version to v0.12.1 in settings, documentation, Dockerfile, and config

* fix(config): update appVersion to remove suffix and align with release v0.12.1

* docs(changelog): update v0.12.1 release notes with new features and improvements

---------

Co-authored-by: Maxim Burgerhout <maxim@wzzrd.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 12:58:42 -04:00
..